7 Replies Latest reply on Mar 15, 2011 4:45 AM by ilya_shaikovsky

    Ajax can't render rich:collapsibleSubTable

    richta

      Hello everybody, The following source is used to add comments to a list of messages (my Richfaces version is 4.0.0.20110227-CR1.)

       

      <rich:dataTable value="#{messages}" var="message">

          <rich:column>

              <rich:collapsibleSubTableToggler for="comments"/>

          </rich:column>

          <rich:column>

              <h:outputText value="#{message.content}" />

          </rich:column>

          <rich:collapsibleSubTable value="#{message.comments}" var="comment" id="comments" expandMode="client">

              <rich:column>

                  <h:graphicImage id="avatar" value="../../../images/activity/avatar.png" />

              </rich:column>

              <rich:column>

                  <h:outputText value="#{comment.content}" />

              </rich:column>

          </rich:collapsibleSubTable>

          <rich:column>

              <h:inputTextarea>..........<h:inputTextarea>

              <a4j:commandButton action="..." value="Add comment" render="#{rich:findComponent('comments').id}" />

          </rich:column>

      </rich:dataTable>

       

      When button "Add comment" was clicked, I checked ajax response and saw the new comment was added, ajax response includes this new information, but the new comment was not rendered in html page.

       

      Anyone knows why, please help, thanks.

        • 1. Ajax can't render rich:collapsibleSubTable
          boy18nj

          1) Add <a4j:outputPanel id="output"> outside <rich:collapsibleSubTable

          2) change it to  <a4j:commandButton render="output"

          • 2. Ajax can't render rich:collapsibleSubTable
            richta

            Thanks Aman,

            I tried to add a4j:outputPanel, but all comments in rich:collapsibleSubTable are not displayed in html page (not display both at first time I go to this page and after adding comments)

            • 3. Ajax can't render rich:collapsibleSubTable
              ilya_shaikovsky

              just try to change render="#{rich:findComponent('comments').id}" to render="comments".

              • 4. Ajax can't render rich:collapsibleSubTable
                richta

                Thanks IIya Shaikovsky,

                I did it before and it does not work also. I check the ajax response and see the information of new comment there, so do you think there is somthing wrong with javascript of client side to rerender rich:collapsibleSubTable?

                • 5. Ajax can't render rich:collapsibleSubTable
                  ilya_shaikovsky

                  please check a4j:log information for failed request.

                  1 of 1 people found this helpful
                  • 6. Re: Ajax can't render rich:collapsibleSubTable
                    richta

                    I checked a4j:log and found something

                     

                    This is my html source before adding comment

                    <table id="message">

                         <tbody id="message:0:tb" class="rf-dt-b"> .... </tbody>     --> message content

                         <tbody id="message:0:comments:c" class="rf-cst">     --> table of comments

                              <tr id="message:0:comments" style="display: none;"> ... </td>

                              <tr id="message:0:comments:0:b" class="rf-cst-fst-r no_border text_align_r valign_t"> ... </td>

                              <tr id="message:0:comments:1:b" class="rf-cst-r no_border text_align_r valign_t"> ... </td>

                         </tbody>

                         <tbody id="message:0:tb" class="rf-dt-b">     --> adding comment area

                         .............................................................

                    </table>

                     

                    This is a4j:log

                     

                    Element update for id=message:0:comments

                    <update id="message:0:comments"><![CDATA[

                         // The date here contains my new comment

                    ]]

                     

                    The updated element supposts to be message:0:comments:c, NOT message:0:comments

                    Do you think this is the reason why comments table is not rerendered correctly?

                     


                    • 7. Re: Ajax can't render rich:collapsibleSubTable
                      ilya_shaikovsky

                      thanks for your patience and input! that's looks weird and I'm confirmed that as issue. Component root element should be the same as component id in order to be ajax rendered fine.

                       

                      https://issues.jboss.org/browse/RF-10756