rich:modal パネルでのウィザードのような動作に問題があります。チュートリアルとこの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>
私のリッチパネル:
<?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>
モーダル パネルはパラメータを正しく取得します。最初のページが開き、その後 Bean が呼び出されます。
これが最初のページです - 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>
h:panelGroup の代わりに ui:composition を使用しようとしました。うまくいきませんでした。2 番目のページも同じ方法で実装されます。
[次へ] をクリックすると、Bean は SUCCESS メッセージを返しますが、ページは変更されません。
お願いします、誰かが何が悪いのか考えていますか?