1 Reply Latest reply on Sep 21, 2012 9:54 PM by fsevero

    a4j:poll rendering without scrolling components

    fsevero

      Hello there,

       

      I'm having some problems using richfaces components in my project. I'm using RichFaces 4.2.2 in JSF 2.1.

       

      My problem is that i'm using some components (rich:tree and h:dataTable) inside rich:panel and i want to render those components every 1 second or less with the changes in the database.

      It works fine with a4j:commandButton, but almost the same code doesn't work with the a4j:poll. Details of the components:

       

      Tree

       

      dataTable

       

      <rich:Panel header="feed" style="overflow:auto">
           <h:dataTable id="panelfeed" value="#{discussionBean.feed}" var=feed>
                <h:column>
                     <h:outputText value="#{feed}"/>
                </h:column>
           </h:dataTable>
      </rich:Panel>
      

       

      First Button

       

      <a4j:commandButton value="Add" action="#{discussionBean.addArgument}" render="panelfeed"/>
      

       

      Second Button

       

      <a4j:commandButton value="Reload" action="#{discussionBean.rebuildTree}" render="panelfeed"/>
      

       

      (The function rebuildTree() is also called inside addArgument() )

       

      The Poll

       

      <a4j:poll action="#{discussionBean.rebuildTree}" render="panelfeed"/>
      

       

      The dataTable have more content that the panel can show. So, the overflow makes the scrollbar appears.

       

      The First and the Second Button reload the content and refresh the result in the webpage without problems, without scrolling the content back to the initial position.

      When the poll is executed, the content is refreshed, but it's scrolled back to the initial positions. Which makes it useless since I can't scroll the panel.

       

      Is there a way of making the a4j:poll reload and refresh the dataTable without moving the scrollbar position?

       

      Thanks in advance.

       

      Att, Fabrício Severo