我的jsp页面中有这段代码用于单选按钮选择:
<a4j:region>
<h:outputText value=" type" styleClass="labelStyle" />
<h:selectOneRadio id="addTypeAction" value="#{Address.addType}" styleClass="labelStyle">
<f:selectItem id="Bya" itemLabel="Report" itemValue="1" />
<f:selectItem id="Byad" itemLabel="Report3" itemValue="2" />
<f:selectItem id="Byadd" itemLabel="Report2" itemValue="3" />
<f:selectItem id="Byadd1" itemLabel="Report4" itemValue="4" />
<f:selectItem id="Byadd2" itemLabel="Report5" itemValue="5" />
<a4j:support event="onclick" action="#{adressBean.getsearchAddType}" reRender="AddressElements" />
</h:selectOneRadio>
</a4j:region>
在操作中,我调用了getsearchAddType
设置searchAdressClicked
布尔值的方法。例如,如果Report
单击我必须将布尔值设置为true
并渲染面板网格。如果单击报告以外的其他内容,我必须将searchAdressClicked
布尔值设置为false
并隐藏面板网格。
问题:
在第一次单击时,当我单击报告单选以外的其他选项时,它会隐藏面板网格并且工作正常。在页面本身中,如果我再次单击,Report
它不会显示相应的面板网格。页面未呈现。
这是我重新渲染的面板网格
<a4j:region>
<a4j:outputPanel id="AddressElements">
<h:panelGroup rendered="#{adressBean.searchAdressClicked}">
<h:panelGrid columns="8">
<h:outputText value="Month" styleClass="labelStyle" />
<h:outputText id="id1" value="address to" styleClass="labelStyle" />
<h:outputText id="id2" value="Addressfrom" styleClass="labelStyle" />
</h:panelGrid>
</h:panelGroup>
</a4j:outputPanel>
</a4j:region>