2 Replies Latest reply on Apr 1, 2014 12:49 AM by Brian Leathem

    How to render all <h:panelGrid> with same id using <r:ajax>

    Jiří Holuša Newbie

      Hi,

       

      I've got the following problem and I'm pretty stuck. I create several <h:panelGrid> with same ID in a <r:repeat> and then there's <r:ajax> which I want it to refresh content of all those panel grids.

       

      How could this be done? My code below refreshes only the last panelGrid, other remaining intact.

       

      Please see the code example below:

       

      <h:form id="container">

           <r:repeat value="#{metricReportBean.charts}" var="chart">

                //create a chart

                <r:ajax event="..." render=":pointDetailsPanel" />

          

                <h:panelGrid id="pointDetailsPanel">

                    //information about selected point that need to be refreshed

                </h:panelGrid>

           </r:repeat>

      </h:form>

       

      Note that if I call the render on ":container" it's working, but I cannot do this because 1) it's non-sense to re-render the whole chart(s) since it doesn't change, 2) I'm drawing something in the chart using JavaScript and when the chart is re-render, my "drawing" is lost (main reason).

       

      But the question is more general: how to re-render more than one <h:panelGrid> with same ID's (using <r:ajax>)? I'm hoping that there's some other notation in render attribute.

       

      Just to be sure I mentioned everything relevant, I'm using this RichFaces dependency:

      <dependency>

           <groupId>org.richfaces.compat</groupId>

           <artifactId>richfaces-components-rich</artifactId>

           <version>4.5.0.Alpha2</version>

      </dependency>

       

      Any help appreciated! Thanks :-)