2012-07-20 2 views
0

데이터가 데이터베이스에 저장되면 양식에서 데이터를 지우는 방법을 아무도 알아 줄 수 있습니까?스프링 웹 플로우에서 양식 지우기

add.xhtml 

     <ui:define name="content"> 

     <h2 style="font-weight:bold;font-size:16px;margin-top:10px;">Register a new employee</h2> 
     <p:panel header="Add a Employee" toggleable="true" toggleSpeed="100"> 
    <h:form style="background: 10px steelBlue;border-radius: 13px;"> 

     <h:panelGrid columns="3" id="leaveform" > 
     <div> 
     <div> 
     <h:outputLabel for="employee">Select the Type employee</h:outputLabel> 
     <h:selectOneMenu id="approveleavetype" value="#{userInfo.loginperson}" required="false" > 
         <f:selectItems value="#{referenceData.loginPersonType}"/> 
        </h:selectOneMenu> 
      </div> 
       <h:outputLabel for="firstname">First Name<em>*</em></h:outputLabel> 



       <h:inputText id="firstname" value="#{userInfo.fname}" 
       required="true" 
       label="fname" style="background-color:#FFF;"> 
      </h:inputText> 


      <div> 

       <h:outputLabel for="lastName">Last Name<em>*</em></h:outputLabel> 



        <h:inputText id="lastname" value="#{userInfo.lname}" 
       required="true" 
       label="lname" style="background-color:#FFF;"> 
      </h:inputText> 


      </div> 
      <div> 
       <h:outputLabel for="emailId">Email Id<em>*</em></h:outputLabel> 



        <h:inputText id="emailId" value="#{userInfo.emailId}" 
       required="true" 
       label="emailId" style="background-color:#FFF;"> 
      </h:inputText> 

      </div> 
      <div> 
       <h:outputLabel for="manager">Manager<em>*</em></h:outputLabel> 



      <h:inputText id="manager" value="#{userInfo.manager}" 
       required="true" 
       label="manager" style="background-color:#FFF;"> 
      </h:inputText> 
      </div> 

      <div> 
       <h:outputLabel for="username">UserName<em>*</em></h:outputLabel> 



      <h:inputText id="username" value="#{userInfo.username}" 
       required="true" 
       label="username" style="background-color:#FFF;"> 
      </h:inputText> 
      </div> 
      <div> 
       <h:outputLabel for="password">Password<em>*</em></h:outputLabel> 



      <h:inputText id="password" value="#{userInfo.password}" 
       required="true" 
       label="password" style="background-color:#FFF;" > 
      </h:inputText> 
      </div> 






     <center><p:commandButton value="Add Employee" action="insertemployee" id="insertemployee" style="margin-left:250px;"/></center> 
    </div> 

메인 flow.xml 데이터가 저장 취득하고 그것을 저장 일단이 같은 page.The 문제에 전환입니다 입력받을되면 여기

   <view-state id="addEmployee"> 
<on-entry> 
<evaluate expression="leaveBo.getallUser()" result="viewScope.allUser"></evaluate> 
</on-entry> 
    <transition on="insertemployee" to="addEmployeeInfo"></transition> 

</view-state> 

    <action-state id="addEmployeeInfo"> 
    <evaluate 
     expression="leaveBo.insertEmpolyee(userInfo.fname,userInfo.lname,userInfo.emailId,userInfo.manager,userInfo.loginperson,userInfo.username,userInfo.password)"></evaluate> 
    <transition to="addEmployee"></transition> 
</action-state> 

입력 한 값이 지워지지 않고 있습니다.

답변

0

value="#{userInfo.username}"과 같은 속성으로 정의 된 입력 필드가 있으므로이 필드를 비워 두려면 userInfo 또는 해당 속성을 명시 적으로 지워야한다고 생각하십니까?

또는 하나의 페이지/뷰에 대해 "로컬"모델 bean을 정의하십시오. JSF를 한번도 해본 적이 없다는 것을 인정하지만, JSF로 WebFlow가 어떤 모습인지 정확히 알지 못합니다.

관련 문제