2 Replies Latest reply on Mar 14, 2012 1:34 AM by vignesh mohan

    rich:dataTable have problems with rerender in h:selectOneMenu

    doctor_f Newbie

      I have one  h:selectOneMenu outer in the rich:dataTable.

      In rich:dataTable one column with h:selectOneMenu.

      When changing the value in the h:selectOneMenu outer table, values in h:selectOneMenu inside a table does not change.

      richfaces 3.3.0

      This code:

      <h:form id="Children_list">

      <a4j:outputPanel>

      <h:panelGrid id="ch_head" columns="2">

      <h:outputText value="Группа: " />

      <h:selectOneMenu value="#{iGarten.selectGroup}">

      <f:selectItems value="#{iGarten.groupsCombolist}" />

      <a4j:support event="onchange" reRender="child_list"/>

      </h:selectOneMenu>

       

      </h:panelGrid>

       

      </a4j:outputPanel>

      <h:panelGrid id="ch_at">

      <rich:dataTable value="#{iGarten.attendance}" var="list"

      id="child_list" styleClass="table-center">

      <f:facet name="header">

      <rich:columnGroup>

      <h:column>

      <h:outputText value="№" />

      </h:column>

      <h:column>

      <h:outputText value="Surname" />

      </h:column>

      <rich:column colspan="2">

      <h:outputText value="Monday" />

      </rich:column>

       

      </rich:columnGroup>

      </f:facet>

       

      <h:column>

      <h:outputText value="#{list.num}" />

      </h:column>

       

      <h:column>

      <h:commandLink action="#{people_Detail.select_child}">

      <h:outputText

      value="<b>#{list.fullName}</b> <i>(#{list.burnDate})</i>"

      escape="false" />

      <f:param name="id" value="#{list.peopleId}" />

      </h:commandLink>

      </h:column>

       

      <!--Monday -->

       

       

      <rich:column rendered="#{list.mondayEdit&&!list.mondayHoliday}" colspan="2">

      <h:selectOneMenu value="#{list.monday}">

      <f:selectItem itemValue="1" itemLabel="Was"/>

      <f:selectItem itemValue="0" itemLabel="Not Was"/>

      <f:selectItem itemValue="-1" itemLabel="Ill"/>

      <a4j:support event="onchange" reRender="ch_at" />

      </h:selectOneMenu>

      <h:graphicImage value="/css/image/accept.gif"

      rendered="#{list.mondayWas&&list.mondayExist}" title="Monday"/>

      <h:graphicImage value="/css/image/decline.gif"

      rendered="#{list.mondayNotWas&&list.mondayExist}" title="Monday"/>

      <h:graphicImage value="/css/image/ill.gif"

      rendered="#{list.mondayIll&&list.mondayExist}" title="Monday"/>

      </rich:column>

       

      <rich:column rendered="#{!list.mondayEdit||list.mondayHoliday}" colspan="2">

      <h:graphicImage value="/css/image/accept.gif"

      rendered="#{list.mondayWas&&list.mondayExist}" title="Monday"/>

      <h:graphicImage value="/css/image/decline.gif"

      rendered="#{list.mondayNotWas&&list.mondayExist}" title="Monday"/>

      <h:graphicImage value="/css/image/ill.gif"

      rendered="#{list.mondayIll&&list.mondayExist}" title="Monday"/>

      <h:graphicImage value="/css/image/holiday.gif"

      rendered="#{list.mondayHoliday&&list.mondayExist}" title="Monday"/>

      </rich:column>

       

      </rich:dataTable>

      <rich:jQuery selector="#child_list tr:odd" query="addClass('odd-row')" />

      <rich:jQuery selector="#child_list tr:even" query="addClass('even-row')" />

      <rich:jQuery selector="#child_list tr"

      query="mouseover(function(){jQuery(this).addClass('active-row')})" />

      <rich:jQuery selector="#child_list tr"

      query="mouseout(function(){jQuery(this).removeClass('active-row')})" />

      </h:panelGrid>

      </h:form>

       

       

        • 1. Re: rich:dataTable have problems with rerender in h:selectOneMenu
          doctor_f Newbie

          I have decided the issue by removing all components of the table from the form.

          Code for removal of components:

          @SuppressWarnings("unchecked")

              private UIComponent findComponent(UIComponent c, String id) {

          if (id.equals(c.getId())) {

          return c;

          }

          Iterator<UIComponent> kids = c.getFacetsAndChildren();

          while (kids.hasNext()) {

          UIComponent found = findComponent(kids.next(), id);

          if (found != null) {

          return found;

          }

          }

          return null;

          }

           

              public void refresh() {

          FacesContext context = FacesContext.getCurrentInstance();

          UIViewRoot root = context.getViewRoot();

           

          final String componentId = "child_list";//id table

          UIComponent c = findComponent(root, componentId);

          c.getChildren().clear();

           

              }

          1 of 1 people found this helpful
          • 2. Re: rich:dataTable have problems with rerender in h:selectOneMenu
            vignesh mohan Newbie

            HI Doc ,

             

            Have you checked the id generation of the childlist using the Firebug ,

             

            That might also be the issue in case of rerendering. The ID that you have passed for the rerendering may be the generated id

             

            If possible check with that

             

            -

            Viki

            1 of 1 people found this helpful