2

I have this piece of code for radio button selection in my jsp page :

<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>

In the action I called the method getsearchAddType to set searchAdressClicked boolean value. Example if Report is clicked I have to set the boolean value as true and render the panel grid. If the other than report is clicked I have to set the searchAdressClicked boolean value as false and hide the panel grid.

Issue:

On the first click, when I click on other than Report radio it hide the panel grid and works fine. In the page itself, if i click again, the Report radio it not showing the corresponding panel grid. The page is not rendered.

This is my re-rendered panel grid

<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>       
GrandMasterFlush
  • 6,269
  • 19
  • 81
  • 104
Rithik_Star
  • 651
  • 5
  • 14
  • 39

0 Answers0