6 Replies Latest reply on Dec 19, 2008 3:00 AM by Nicole Müller

    a4j:support selectOneRadio rerendering not working

    Nicole Müller Novice


      I want to use a <h:selectOneRadio> with a4j:support. If the value changes in the selectOneRadio, the <h:listbox id="groups...> should be rerendered.

      <h:selectOneRadio layout="pagedirection" value="#{appointmentBean.appointmentType}">
       <f:selectItem itemValue="#{appointmentBean.appointmentType_general}" itemLabel="fuer alle verfuegbar" />
       <f:selectItem itemValue="#{appointmentBean.appointmentType_group}" itemLabel="fuer Gruppe verfuegbar"/>
       <a4j:support event="onchange" reRender="groups" />
       <h:selectOneListbox value="#{appointmentBean.relatedGroupId}" id="groups" rendered="#{appointmentBean.appointmentType_group}">
       <f:selectItems value="#{groupBean.allGroupsAsItems}"/>

      If the value of the radiobutton is
      the listbox should not be rendered because there is a rendering condition:
      <h:selectOneListbox value="#{appointmentBean.relatedGroupId}" id="groups" rendered="#{appointmentBean.appointmentType_group}">

      My first problem is that if I invoke the page at the first time, the selectOneRadio-Boxes are both unselected.
      But in my bean I initialized the values:

      The second problem is that if I change the value in the selectOneRadio the ajax request is fired. I can see in the debugger that in my bean the isAppointmentType_group() method is invoked and the values are set right. But on the page the listbox is not rendered.

      Here is my beancode:
       public void setAppointmentType(String appointmentType) {
      public boolean isAppointmentType_general() {
       return appointmentType_general;
       public void setAppointmentType_general(boolean appointmentType_general) {
       this.appointmentType_general = appointmentType_general;
       public boolean isAppointmentType_group() {
       return appointmentType_group;
       public void setAppointmentType_group(boolean appointmentType_group) {
       this.appointmentType_group = appointmentType_group;

      Any ideas?
      Thanks, Nicki