3 Replies Latest reply on Aug 5, 2008 3:01 AM by cash1981

    How to add a new row to a4j:repeat?

      I have run into an issue where the reRendering of a rich:dataTable on 100+ lines is extremely slow (10-25 sec). If I am just updating a single existing row in the table this is not a problem as I can use the ajaxKeys. The problem is when I need to simply add a new blank edittable row in the middle of the table I am then forced to reRender the entire table. Adding a datascroller to the table is not a option, the users want to see all the rows.

      The only solution I have been able to come up with is to just use javascript to quickly add a row to the table and then just send a request to the server to update the model separately thus skipping the reRender in the response. This does not work when the form is submitted since the rows get out of wack which I am guessing is because the component state is out of sync. What do I need to update on the server in terms of the UI/Component model to get this work OR is there a better solution.

        • 1. Re: How to add a new row to a4j:repeat?

          Well, I found that if I use a4j:repeat to build the table instead of rich:dataTable it is faster. Adding a line takes about 5 seconds in table with 100 rows and 10 columns. This is a little better....

          • 2. Re: How to add a new row to a4j:repeat?
            cash1981

            A question.
            Do you by any chance know how to get a line break in the table column when using a4j:repeat?
            My code loops through a lists and prints out a value. I would like to have a line break when the value is printed in the column.

            Appreciate...

            • 3. Re: How to add a new row to a4j:repeat?
              cash1981

              I found out the answer.
              The trick is to use <s:fragment>

              <a4j:repeat id="tidsromResultList" var="tidList" value="#{tidsromResultList}">
              <s:fragment rendered="#{tidList.bevilling.bevillingId == omsetList.bevilling.bevillingId}">
              <h:outputText value="#{tidList.start} - #{tidList.end}" />
              <br/>
              </s:fragment>
              </a4j:repeat>