2012-12-03 2 views
0

리치 : 모달 패널에서 마법사와 비슷한 동작에 문제가 있습니다. 자습서를 읽고이 http://maxkatz.sys-con.com/node/1428854/mobile과이 http://www.mkyong.com/jsf2/jsf-form-action-navigation-rule-example/을 읽었습니다. 그러나 그들 중 누구도 도움이되지 않았습니다. 다음과 같이 내 코드는 다음과 같습니다리치 : 모달 패널 마법사 동작이 작동하지 않습니다.

얼굴-설정 :

<!-- WizardProject --> 
    <navigation-rule> 
    <from-view-id>/widgets/wizard/ProjectStep.xhtml</from-view-id> 
    <navigation-case> 
     <from-action>#{projectWizard.goNext}</from-action> 
     <from-outcome>SUCCESS</from-outcome> 
     <to-view-id>/widgets/wizard/InfoStep.xhtml</to-view-id> 
    </navigation-case> 
    <navigation-case> 
     <from-action>#{projectWizard.goNext}</from-action> 
     <from-outcome>FAIL</from-outcome> 
     <to-view-id>/widgets/wizard/InfoStep.xhtml</to-view-id> 
    </navigation-case> 
</navigation-rule> 

내 Richpanel :

<?xml version="1.0" encoding="UTF-8"?> 

<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:c="http://java.sun.com/jstl/core" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:a4j="http://richfaces.org/a4j" 
    xmlns:rich="http://richfaces.org/rich"> 

<!-- 
    Parameters: 
     id - modal dialog id 
     bean 
     src - firstWizardPage 
--> 

<rich:modalPanel id="#{id}" width="750" resizeable="false" autosized="true"> 

     <f:facet name="header"> 
     <h:panelGroup> 
       <h:outputText value="Wizard"/> 
     </h:panelGroup> 
     </f:facet> 
     <h:form> 
     <h:panelGroup id="test"> 
      <a4j:include id="wizardPage" viewId="#{src}"/> 
     </h:panelGroup> 
     </h:form> 
    </rich:modalPanel> 
</ui:composition> 

모달 패널이 제대로 parametrs을 가져옵니다. 주먹 페이지가 열리고 bean이 나중에 호출됩니다. 대신 시간의 구성 : panelGroup 내가 UI를 사용하려고했습니다 ProjectStep.xhtml

<h:panelGroup xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:a4j="http://richfaces.org/a4j" 
    xmlns:rich="http://richfaces.org/rich" 
    xmlns:c="http://java.sun.com/jstl/core"> 


     <h:outputText value="I've opened up #{bean}" /> 
     <h:inputText value=" " /> 
     <div class="actionButtons"> 
     <div class="actionCancelButtons"> 
      <a4j:commandButton id="btnNext" 
          value="Next" 
          action="#{bean.goNext()}" 
          style="display:#{bean.isCanGoNext() ? '' : 'none'}" 
          reRender="test"/> 

      <a4j:region> 
      <a4j:commandButton onclick="#{rich:component(id)}.hide()" 
           value="Cancel" 
           style="display:#{bean.isCanCancel() ? '' : 'none'}"/> 
      </a4j:region> 
     </div> 
     </div> 




</h:panelGroup> 

-

여기에 첫 번째 페이지입니다. 그것은 작동하지 않았다. 두 번째 페이지는 같은 방식으로 구현됩니다.

다음을 클릭하면 bean은 SUCCESS 메시지를 반환하지만 페이지는 변경되지 않습니다.

무엇이 잘못 되었습니까?

답변

0

faces_config.xml에 <redirect/> 속성을 추가하고 <a4j:include/>ajaxRendered="true"을 사용해보세요. 귀하의 탐색 케이스가 호출되고 있는지 확인하십시오. faces_config는

<navigation-rule> 
    <from-view-id>/widgets/wizard/ProjectStep.xhtml</from-view-id> 
    <navigation-case> 
     <from-action>#{projectWizard.goNext}</from-action> 
     <from-outcome>SUCCESS</from-outcome> 
     <to-view-id>/widgets/wizard/InfoStep.xhtml</to-view-id> 
     <redirect/> 
    </navigation-case> 
    <navigation-case> 
     <from-action>#{projectWizard.goNext}</from-action> 
     <from-outcome>FAIL</from-outcome> 
     <to-view-id>/widgets/wizard/InfoStep.xhtml</to-view-id> 
     <redirect/> 
    </navigation-case> 
</navigation-rule> 
과 같이 표시되어야합니다.
관련 문제