私は一緒に働いています:
- RichFaces 4.2.2
- Mojarra 2.1.14
以下の簡単なコードを見てみましょう。
<h:form>
<h:selectOneRadio value="#{testBean.option}" >
<f:selectItem itemValue="0" itemLabel="Option 0"/>
<f:selectItem itemValue="1" itemLabel="Option 1"/>
<f:ajax execute="@this" render="infoPanelId"/>
</h:selectOneRadio>
<a4j:outputPanel id="infoPanelId">
<h:outputText value="Option 0 selected" rendered="#{testBean.option == '0'}"/>
<h:outputText value="Option 1 selected" rendered="#{testBean.option == '1'}"/>
</a4j:outputPanel>
</h:form>
そしてビーンコード:
@ManagedBean(name="testBean")
@ViewScoped
public class TestBean implements Serializable{
private String option;
public String getOption() {
return option;
}
public void setOption(String option) {
this.option = option;
}
}
それはうまく機能し、簡単です。再レンダリングは期待どおりに機能します。しかし、この単純なコードを rich:popupPanel タグ内に配置すると、そのコードは機能しません。これはコード スニペットです。
<h:form>
<a4j:commandButton
value="show popup"
oncomplete="#{rich:component('testPopup')}.show()"
render="testPopup"
/>
<rich:popupPanel id="testPopup" modal="false" autosized="true" resizable="false">
<f:facet name="header">
<h:outputText value="popup"/>
</f:facet>
<h:panelGrid columns="1">
<h:selectOneRadio value="#{testBean.option}" >
<f:selectItem itemValue="0" itemLabel="Option 0"/>
<f:selectItem itemValue="1" itemLabel="Option 1"/>
<f:ajax execute="@this" render="infoPanelId"/>
</h:selectOneRadio>
<a4j:outputPanel id="infoPanelId">
<h:outputText value="Option 0 selected" rendered="#{testBean.option == '0'}"/>
<h:outputText value="Option 1 selected" rendered="#{testBean.option == '1'}"/>
</a4j:outputPanel>
</h:panelGrid>
</rich:popupPanel>
</h:form>
したがって、popupPanel 内のコードは機能しません。popupPanel の一部を再レンダリングできません。だから私は2つの質問があります:
- なぜ?
- どうすればそれを機能させることができますか?