0 Replies Latest reply on Mar 2, 2013 2:20 PM by Stephan Leutenmayr

    a4j:commandLink rerender renders old datalist

    Stephan Leutenmayr Newbie



      I use a rich:datalist to display comments on a website. The datalist is backed by a @Datamodel and generated by a @Factory. I want to use an a4j:commandLink to for voting on the single comments. Upon voting, the updated vote count should be displayed next to the commandLinks. The action of the commandLink is properly executed, but the datalist still displays the old vote count. Only upon site refresh (F5) is the updated vote count displayed. Also, the @Factory method for generating the datalist is execute prior to the actual action method of the commandLink. What do I have to do to achieve a display of the updated vote count?


      Thank you






      <a4j:outputPanel id="commentRegion">

                <a4j:form id="commentForm">

                          <rich:dataList id="commentList" var="item"


                                    <h:outputLabel value="#{item.comment.text}" />

                                    <br />

                                              <a4j:commandLink value="ja"


                                                        rerender="commentRegion" />

                                              <h:outputText value="(#{item.countYes})" />

                                              <a4j:commandLink value="nein"


                                                        rerender="commentRegion" />

                                              <h:outputText value="(#{item.countNo})" />