title: t:dataScroller variables not updating when t:datascroller is before t:dataTable
body: <p>t:dataScroller variables not updating when t:datascroller is before t:dataTable</p>
  
  <p>I've spent some time looking for an answer here as well as other sites, but haven't come across anyone else with the same problem, let alone suggested answers.</p>
  
  <p>I understand myfaces t:datascroller is equally functional whether it is placed before or after t:datatable in facelets, as long as the 'for' attribute is set to the datatable id. I have a commandLink that causes a search criteria to be to be posted, resulting in a revised dataset populating the datatable. The datatable itself gets updated correctly everytime a different search criteria is sent by the commandLink. When the t:datascroller is placed after the datatable in the markup, the scroller gets updated correctly everytime. But not when it is placed before the datatable, in which case it requires two clicks of the commandLink, basically a refresh; then the scroller (scroller 2 here) values (pageCountVar,pageIndexVar) are one step behind the displayed datatable. The scroller is showing the variables for the previous search results.</p>
  
  <p>Not being a JSF2 expert, a few things that I've tried unsuccessfully are
  1. true and false for the immediate= for scroller and datatable
  2. forceId=, setting this to true on the scroller causes the goToLast element button to stop working, so removed it
  3. had the datascroller and the datatable as children of the same panelGroup
  4. tried $ instead of # for all the datascroller variables
  5. fully qualifying the values for the 'for=' attributes
  6. tried commandButton, as well as commandLink for triggering the post</p>
  
  <p>I'm running tomahawk21 1.1.14 + mojarra 2.1.6 in Tomcat 7.0.47.</p>
  
  <p>Any help is greatly appreciated here.</p>
  
  <pre><code>    &lt;div id="my_datatable_div"&gt;
  
          &lt;div id="scroll2_div"&gt;
              &lt;h:panelGroup rendered="${!myData.hasRows}"&gt;No folders found.&lt;/h:panelGroup&gt;
              &lt;t:dataScroller id="scroll_2"
                for="my_datatable"
                style="margin:auto;padding:0;border:10px solid #ff0000;"
                rowsCountVar="rowsCount"
                displayedRowsCountVar="displayedRowsCountVar"
                firstRowIndexVar="firstRowIndex"
                lastRowIndexVar="lastRowIndex"
                pageCountVar="pageCount"
                immediate="false"
                pageIndexVar="pageIndex"
                rendered="${myData.hasRows}"
                &gt;
                &lt;h:outputFormat value="Filtered :{0}, showing {1}: from {2} to {3}, Page {4}/{5}."&gt;
                  &lt;f:param value="#{rowsCount}" /&gt;
                  &lt;f:param value="#{displayedRowsCountVar}" /&gt;
                  &lt;f:param value="#{firstRowIndex}" /&gt;
                  &lt;f:param value="#{lastRowIndex}" /&gt;
                  &lt;f:param value="#{pageIndex}" /&gt;
                  &lt;f:param value="#{pageCount}" /&gt;
                &lt;/h:outputFormat&gt;
              &lt;/t:dataScroller&gt;
          &lt;/div&gt;
          &lt;div id="scroll1_div"&gt;
              &lt;t:dataScroller id="scroll_1"
                styleClass="scroller1Style"
                paginatorTableStyle="scroll1PaginatorTableStyle"
                paginatorColumnClass="scoller1PaginatorColumnClass"
                paginatorActiveColumnClass="scroller1PaginatorActiveColumnClass"
                for="my_datatable"
                fastStep="10"
                pageCountVar="pageCount"
                pageIndexVar="pageIndex"
                paginator="true"
                paginatorMaxPages="9"
                paginatorTableClass="paginator"
                paginatorActiveColumnStyle="font-weight:bold;"
                rendered="${myData.shouldShowPaginator}"
                immediate="false"&gt;
  
                &lt;f:ajax execute="my_datatable scroll_2 scroll_1" render="my_datatable scroll_2 scroll_1 "/&gt;
  
                &lt;f:facet name="first" &gt;
                    &lt;h:graphicImage style="border:0;margin-right:15px;" library="icons20121211" name="Beginning-16x16.png" /&gt;
                &lt;/f:facet&gt;
                &lt;f:facet name="last"&gt;
                    &lt;h:graphicImage style="border:0;margin-right:0;" library="icons20121211" name="Last-16x16.png" /&gt;
                &lt;/f:facet&gt;
                &lt;f:facet name="previous"&gt;
                    &lt;h:graphicImage style="border:0;margin-right:15px;" library="icons20121211" name="Previous-16x16.png" /&gt;
                &lt;/f:facet&gt;
                &lt;f:facet name="next"&gt;
                    &lt;h:graphicImage style="border:0;margin-right:15px;margin-left:15px;" library="icons20121211" name="Next-16x16.png" /&gt;
                &lt;/f:facet&gt;
                &lt;f:facet name="fastforward"&gt;
                    &lt;h:graphicImage style="border:0;margin-right:15px;" library="icons20121211" name="FastForward-16x16.png" /&gt;
                &lt;/f:facet&gt;
                &lt;f:facet name="fastrewind"&gt;
                    &lt;h:graphicImage style="border:0;margin-right:15px;" library="icons20121211" name="FastRewind-16x16.png" /&gt;
                &lt;/f:facet&gt;
              &lt;/t:dataScroller&gt;
          &lt;/div&gt;
            &lt;t:dataTable id="my_datatable"  forceId="true"
  
                immediate="true"
  
                styleClass="my_datatable_style"
                headerClass="standardTable_Header"
                footerClass="standardTable_Header"
                rowClasses="standardTableRowClass"
                rowOnMouseOver="this.style.backgroundColor='#FAFF67'"
                rowOnMouseOut="this.style.backgroundColor='#F5F5F5'"
                rowOnClick="this.style.backgroundColor='#FFE0E0'"
  
                var="dataItem"
                value="#{myData.list}"
                first="#{myData.firstRowIndex}"
                preserveDataModel="false"
                rows="#{myData.rowCount}"&gt;
  
                &lt;t:column styleClass="${myData.columnStyleFor(dataItem)}"&gt;
                 .....
                &lt;/t:column&gt;
  
          &lt;/t:dataTable&gt;
  
      &lt;/div&gt;
  </code></pre>