actionListener In a4j:support Not Invoked
pscheung Jan 2, 2009 5:32 AMI was using v3.3.0.CR1, and I was trying to create a multi-level search criteria, based on the previous selection, different search criteria was displayed. The first level was a selectOneRadio button, and the second level could be either a selectOneMenu or selectOneRadio. Both levels were displayed fine. However, in the level2b (see code below), the actionListener "processProductClassInstanceValue" was not invoked at all (the a4j:support was executed, because I could see "isSecondLevelxxxDisplayable" & "isThirdLevelxxxDisplayable" were invoked) after the "productClassInstance2b" radio button was clicked. I wonder how come it was not invoked? The purpose of the actionListener "processProductClassInstanceValue" was to grab the value of the radio button and based on it "isThirdLevelxxxDisplayable" determine to display the third level or not. I wonder if this is the correct way of getting value from the radio button? I wonder how I am able to limit the rerendering to only inside outputPanel "inner3"(currently, I could see both "isSecondLevelxxxDisplayable" & "isThirdLevelxxxDisplayable" were invoked. Only methods applicable to "inner3" should be executed)? Thanks alot.
<h:form id="searchCriteriaForm" accept="text/html" acceptCharset="UTF-8" enctype="UTF-8"> <!-- Level 1 Begins --> <h:panelGrid id="level1" columns="5"> <h:selectOneRadio value="#{usageDetailBean.billProductClassSelected}"> <a4j:support event="onclick" actionListener="#{detailBean.processProductClassValue}" reRender="inner2" bypassUpdates="false"/> <f:selectItems value="#{detailBean.billProductClasses}"/> </h:selectOneRadio> </h:panelGrid> <!-- Level 1 Ends --> <!-- Inner 2 Begins --> <a4j:outputPanel id="inner2" layout="block"> <h:panelGrid id="level2a" columns="5" rendered="#{detailBean.secondLevelInstanceDisplayable}"> <h:graphicImage id="arrow2a" width="93" height="65" hspace="10" align="left" alt="" url="/images/arrow.gif" rendered="#{detailBean.secondLevelInstanceDisplayable}"/> <h:outputLabel for="instance2a" value="Select phone number" rendered="#{detailBean.secondLevelInstanceDisplayable}"/> <h:selectOneMenu id="instance2a" value="#{detailBean.serviceInstanceSelected}" rendered="#{detailBean.secondLevelInstanceDisplayable}"> <f:selectItems value="#{detailBean.instanceItems}"/> </h:selectOneMenu> <br/><br/> <h:commandButton id="viewDetail2a" value="View details" action="nextPage" rendered="#{detailBean.secondLevelInstanceDisplayable}"/> </h:panelGrid> <!--/a4j:outputPanel--> <!--a4j:outputPanel id="inner2b" layout="block"--> <h:panelGrid id="level2b" columns="5" rendered="#{detailBean.secondLevelProductClassInstanceDisplayable}"> <h:graphicImage id="arrow2b" width="93" height="65" hspace="10" align="left" alt="" url="/images/arrow.gif" rendered="#{detailBean.secondLevelProductClassInstanceDisplayable}"/> <h:outputLabel for="productClassInstance2b" value="Select phone number" rendered="#{detailBean.secondLevelProductClassInstanceDisplayable}"/> <h:selectOneRadio id="productClassInstance2b" value="#{detailBean.productClassServiceInstanceSelected}" rendered="#{detailBean.secondLevelProductClassInstanceDisplayable}"> <a4j:support event="onclick" actionListener="#{detailBean.processProductClassInstanceValue}" reRender="inner3" bypassUpdates="false"/> <f:selectItems value="#{detailBean.productClassInstanceItems}"/> </h:selectOneRadio> <br/><br/> </h:panelGrid> </a4j:outputPanel> <!-- Inner 2 Ends --> <!-- Inner 3 Begins --> <a4j:outputPanel id="inner3" layout="block"> <h:panelGrid id="level3" columns="5" rendered="#{detailBean.thirdLevelInstanceDisplayable}"> <h:graphicImage id="arrow3" width="93" height="65" hspace="10" align="left" alt="" url="/images/arrow.gif" rendered="#{detailBean.thirdLevelInstanceDisplayable}"/> <h:outputLabel for="serviceInstance3" value="Select phone number" rendered="#{detailBean.thirdLevelInstanceDisplayable}"/> <h:selectOneMenu id="serviceInstance3" value="#{detailBean.serviceInstanceSelected}" rendered="#{detailBean.thirdLevelInstanceDisplayable}"> <f:selectItems value="#{detailBean.instanceItems}"/> </h:selectOneMenu> <br/><br/> <h:commandButton id="viewDetail3" value="View details" action="nextPage" rendered="#{detailBean.thirdLevelInstanceDisplayable}"/> </h:panelGrid> </a4j:outputPanel> <!-- Inner 3 Ends --> <rich:messages/> </h:form>