3 Replies Latest reply on Oct 4, 2012 4:13 PM by juhipuro

    Rich:datascroller does not refresh when backing bean data refreshes

    juhipuro

      I have a rich datatable where each row has a stub that opens. User can only open one stub at a time.

      That each Stub has a jsp included which has another rich datatable with a datascroller. Everything works fine except for one problem

       

      say user opens one stub and the list of items shows up. The user clicks on page 4. the table displays page 4 data just fine.

       

      User opens another stub. The datascroller has page number set to 1 but the data still shows from page 4. the data is correct just that its page 4 data and not page 1.

       

      here's the code. Any help is appreciated. I have trimmed the list of column for easy read.

       

      main jsp

       

      <%@ taglib uri="/WEB-INF/tlds/myfaces_html.tld" prefix="h"%>

      <%@ taglib uri="/WEB-INF/tlds/myfaces_core.tld" prefix="f"%>

      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>

      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

      <%@ taglib uri="/WEB-INF/tlds/tomahawk.tld" prefix="t" %>

       

       

      <t:panelGrid id="offerConstructPanelGrid" columns="1" align="left" width="100%" cellpadding="0" cellspacing="0" rowClasses="top, top">

                <t:panelGrid align="center" cellpadding="5" id="offerConstructPanelGrid4" columns="1" styleClass="gpo_panel" rowClasses="top" >

                           <rich:dataTable id="offerConstructTable" rows="25" value="#{PRODUCTS_PRICING.constructModelList}" var="constructModel" width="100%" headerClass="data_table_header" rowClasses="data_table_row_odd, data_table_row_even"

                               styleClass="summary_table" columnClasses="center, center, center, center, center, center" rendered="#{(! empty PRODUCTS_PRICING.constructModelList)}" binding="#{PRODUCTS_PRICING.constructHeaderDataRow}">

                               <f:facet name="header">    

                                   <rich:columnGroup>

                                                        <rich:column>

                                                                  <h:outputText value=" " />

                                                        </rich:column>     

                                   </rich:columnGroup>

                               </f:facet>

       

                                    <rich:column>

                                              <a4j:commandButton id="offerConstructTable_closedBtn" image="/images/closed_arrow.gif" rendered="#{!constructModel.itemSubTableOpen}" action="#{PRODUCTS_PRICING.toggleConstructItemSubTable}" reRender="offerConstructTable">

                                                        <a4j:actionparam name="tierId" value="#{constructModel.construct.constructId}" />

                                              </a4j:commandButton>

                                              <a4j:commandButton id="offerConstructTable_openBtn" image="/images/open_arrow.gif" rendered="#{constructModel.itemSubTableOpen}" action="#{PRODUCTS_PRICING.toggleConstructItemSubTable}" reRender="offerConstructTable">

                                                        <a4j:actionparam name="tierId" value="#{constructModel.construct.constructId}" />

                                              </a4j:commandButton>

                                    </rich:column>

       

       

                                    <rich:column colspan="5" style="margin: 0px; padding: 0px;" rendered="#{constructModel.itemSubTableOpen}">

                                              <jsp:include flush="true" page="/jsp/shared/items/offerItemSubTablePanel.jsp" />

                                    </rich:column>    

       

                          </rich:dataTable>

       

                    <rich:datascroller id="offerConstructTableScroller" for="offerConstructTable" maxPages="10" rendered="#{(! empty PRODUCTS_PRICING.constructModelList)}" renderIfSinglePage="false" 

                        oncomplete="Richfaces.hideModalPanel('ajaxRequestModalPanel')" onbeforedomupdate="Richfaces.hideModalPanel('ajaxRequestModalPanel')" ajaxSingle="true" reRender="offerConstructTable"/>

       

                </t:panelGrid>

      </t:panelGrid>

       

      included jsp

       

      <%@ taglib uri="/WEB-INF/tlds/myfaces_html.tld" prefix="h"%>

      <%@ taglib uri="/WEB-INF/tlds/myfaces_core.tld" prefix="f"%>

      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>

      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

      <%@ taglib uri="/WEB-INF/tlds/tomahawk.tld" prefix="t" %>

       

       

          <t:panelGrid align="center" cellpadding="5" id="constructItemsMainGrid" columns="1" styleClass="gpo_panel" rowClasses="top" >

              <rich:dataTable id="constructItemsTable" rows="5" value="#{ITEM_UPLOAD.itemListForATier}" var="model" width="100%" headerClass="data_table_header" rowClasses="data_table_row_odd, data_table_row_even"

                  styleClass="summary_table" columnClasses="left, center, center, center, center, right, right, center, center" rendered="#{(! empty ITEM_UPLOAD.itemListForATier)}" reRender="constructItemsTableScroller">

                  <f:facet name="header">

                      <rich:columnGroup>

                          <rich:column>

                              <h:outputText id="tierItemsTableMfgPartNumHeader" value="#{msgs.tableheader_mfgPartNum}" />

                          </rich:column>             

       

       

                          <rich:column>

                              <h:outputText id="tierItemsTableExpirationDateHeader" value="#{msgs.tableheader_expirationDate}" />

                          </rich:column>                  

                      </rich:columnGroup>

                  </f:facet>

       

       

                  <rich:column>

                      <h:outputText id="tierItemsTableMfgPartNum" value="#{model.mfgPartNumber}" />

                  </rich:column>

       

       

                  <rich:column>

                      <h:outputText id="tierItemsTableExpirationDate" value="#{model.expirationDate}">

                          <f:convertDateTime pattern="#{msgs.dateformat_standard}" />

                      </h:outputText>

                  </rich:column>

       

       

              </rich:dataTable>

       

              <rich:datascroller id="constructItemsTableScroller" for="constructItemsTable" maxPages="10" rendered="#{(! empty ITEM_UPLOAD.itemListForATier)}" renderIfSinglePage="false" page="#{ITEM_UPLOAD.tierItemsPageNum}"

                  oncomplete="Richfaces.hideModalPanel('ajaxRequestModalPanel')" onbeforedomupdate="Richfaces.hideModalPanel('ajaxRequestModalPanel')" ajaxSingle="true" reRender="offerConstructTable"/>

       

       

         </t:panelGrid>