Trouble in rerender multiple components on value change
amitnair.java Mar 22, 2007 9:17 AMHi Team
I am having trouble in rerendering multiple components on change of value of radio button. My code is
JSP Code:---
<h:selectOneRadio value="#{siteRequirementBean.whetherWantToAddFloorSelected}" id="selectOneRadioId" >
<f:selectItems value="#{siteRequirementBean.whetherWantToAddFloorValues}" />
<a4j:support event="onclick" actionListener="#{siteRequirementBean.displayFloor}" ajaxSingle="true" reRender="dataTableFloorId,PanelGroupUserGroupAssocId" />
</h:selectOneRadio>
Relavant backing bean method:--
ActionListener in BackingBean, ?Backing Bean is in session Scope ?
public void displayFloor (ActionEvent event)
{
if (whetherWantToAddFloorSelected == null)
{
whetherWantToAddFloorSelected = new Integer(0);
displayUserGroupAssoc = false;
}
else if (whetherWantToAddFloorSelected == 1)
{
createFloor ();
displayUserGroupAssoc = true;
}
else if (whetherWantToAddFloorSelected == 0)
{
floorRequirementSetMetaDataList.clear ();
displayUserGroupAssoc = false;
}
}
JSP Code of components which are required to be rerendered:---
<h:dataTable id="dataTableFloorId" value="#{siteRequirementBean.myFloorList}" var="var1">
<%-- Code for DataTable goes here--%>
</h:dataTable>
<h:panelGroup id="PanelGroupUserGroupAssocId" rendered=? displayUserGroupAssoc?>
<h:outputText value="Select Profile" />
<h:graphicImage url="../../images/spacer.gif" width="15" height="5" />
<h:selectOneMenu value="#{siteRequirementBean.selectedUserProfile}" id="selectOneMenuId222">
<f:selectItems value="#{siteRequirementBean.userProfileValues}" />
<a4j:support event="onchange" actionListener="#{siteRequirementBean.loadProfiles}" ajaxSingle="true" reRender="dataTableUserProfileId" />
</h:selectOneMenu>
</h:panelGroup>
On change of value of radio button, the displayFloor method in the backing bean gets called, it create the content for the ?dataTableFloorId? & sets the rendering property [displayUserGroupAssoc] for panelGroup to true. The datatable comes fine with the data, but the panelGroup is not getting displayed. In debug mode I confirmed that value of the property displayUserGroupAssoc is set as true when user changes the value of radio button?..
Please let me have your valuable input ??
Thanks & Regards.
Amit Kumar