2013-04-09 84 views
0

我嘗試了很多東西,但它不工作,我有一個嚮導到對話框中,當我提交表單並重新打開對話框時,我發現它在最後一個數據中,它是我的代碼:清除對話框JSF

 <p:wizard id="wizForNewIssue" widgetVar="wizNewIsssue" 
     flowListener="#{managedBeanProjects.onFlowProcess}" 
     style="width:100%;"> 

     <p:tab id="personal" title="Details"> 
      <p:panel style="width:800px;height:200px"> 
       <h:messages errorClass="error" /> 
       <h:panelGrid id="new0" columns="3"> 
                ........... 
        </h:panelGrid> 
       <f:facet name="footer"> 
       <h:outputText value="Skip to last: " /> 
       <h:selectBooleanCheckbox value="#{managedBeanProjects.skip}" /> 
       </f:facet> 
      </p:panel> 
     </p:tab> 

     <p:tab id="version" title="Version Details"> 
      <p:panel style="width:800px;height:200px"> 
       ............ 
      </p:panel> 
     </p:tab> 

     <p:tab id="goConfirm" title="Confirmation"> 
      <p:panel style="width:800px;height:200px"> 

       <h:panelGrid id="final" columns="4"> 
               .............     
       </h:panelGrid> 

       <f:facet name="footer"> 
       <p:commandButton value="Submit" 
        update=":form1:growl :form1:dialogNewIssue " 
        actionListener="#{managedBeanProjects.newIssue}" 
        oncomplete="newDialog.hide()" /> 
       </f:facet> 
      </p:panel> 
     </p:tab> 
    </p:wizard> 


    </p:dialog> 
+1

顯示如何打開對話框。關鍵點在於你應該在打開之前更新對話框,以便在當前模型狀態下得到反映(你應該事先清除掉你自己)。 – BalusC 2013-04-09 16:24:59

+0

這可能會幫助你:http://www.primefaces.org/showcase/ui/resetInput.jsf – 2013-04-09 16:34:11

+0

對BalusC:當我打開對話我打電話只是.show(),我也有所有更新的ID對話框,我嘗試使用ID嚮導,這不是解決方案。 To RongNk:我希望提交按鈕後所有輸入都是乾淨的,並且重定向到嚮導的第一個選項卡 – HamzaNTFS 2013-04-09 16:54:01

回答

0

Primefaces嚮導有 「臺階」 屬性設置 「ID在流當前步驟」,可以設置標籤的ID您想顯示:

<p:wizard step="#{managedBeanProjects.tabIndex}" id="wizForNewIssue" widgetVar="wizNewIsssue" 
     flowListener="#{managedBeanProjects.onFlowProcess}" 
     style="width:100%;"> 

豆:

if(true){ 
tabIndex = "personal"; 
} 
0
<p:dialog id="roleMenuDialog" widgetVar="menuRoleName" 
            modal="true" header="Update User Role" resizable="false" 
            width="220" draggable="false" onHide="desableScroll(1);" onShow="desableScroll(0);"> 

            <p:ajax event="close" resetValues="msgRole" immediate="true" update="roleMenuDialog"/> 
            <h:message for="activeRoleMenu" id="msgRole" 
             style="color:red;" /> 
            <p:outputPanel id="panelGridMenu" layout="block"> 
             <h:panelGrid columns="2" styleClass="cleanTable"> 
              <p:selectOneMenu id="activeRoleMenu" 
               value="#{userAdministrationBean.selectedRoleMap}" 
               style="width:130px;" required="true" 
               requiredMessage="#{msg['useradmin.required.role']}"> 
               <f:selectItem itemLabel="-- SELECT ROLE --" 
                noSelectionOption="true" /> 
               <f:selectItems 
                value="#{userAdministrationBean.userRolesMapDtos}" 
                var="role" itemValue="#{role}" 
                itemLabel="#{role.roleId.roleName}" /> 
               <f:converter 
                converterId="com.dgsl.jam.convertor.GenericConvertor" /> 
              </p:selectOneMenu> 

              <p:commandButton id="activeRoleSaveButton" 
               styleClass="btn btn-default btn btn-default-userRole" 
               value="OK" 
               actionListener="#{userAdministrationBean.updateUser(index, admin,'activeRoleMenu','activeRoleEditButton','activeRoleSaveButton','activeRoleCancleButton', 'rolePanelGroup')}" 
               update="msgRole,activeRole" process="@this,panelGridMenu" /> 
             </h:panelGrid> 
            </p:outputPanel> 
           </p:dialog> 
+0

關閉對話框後,消息被重置。 – 2014-11-14 12:31:41