【发布时间】:2014-07-25 12:05:46
【问题描述】:
在页面初始加载期间渲染工作正常,但是一旦提交表单并且某些组件失败,验证重新渲染不会触发,面板不再显示和隐藏,必须再次刷新页面。我还是 jsf 的新手。
示例代码
<p:selectOneRadio id="accommodationOptions" value="#{travelRequestMBean.accommodationOptions}">
<f:selectItem itemLabel="#{field['accord3Radio2']}" itemValue="2" />
<f:selectItem itemLabel="#{field['accord3Radio1']}" itemValue="1" />
<f:ajax render="panelMoreAccommodation2"/>
</p:selectOneRadio>
<p:panel id="panelMoreAccommodation2" widgetVar="panelMoreAccommodation2"
visible="#{travelRequestMBean.accommodationOptions == 1}" closable="true" toggleable="true">
<p:graphicImage url="/images/hotel-noun_project_4398.svg" alt="#{field['accord3Label2']}" height="24px" />
<h:outputText value="#{field['accord3Label2']}" />
</p:panel>
我还尝试了另一种变体,使用支持 bean 中的布尔属性和 selectoneradio 上的 ajax 事件,结果仍然相同,面板不执行任何操作。
【问题讨论】:
标签: ajax jsf primefaces