commandLink in dataTable stops dataScroller from working
deadlock_gr Dec 29, 2009 8:41 AMIn a dataTable, when I use a commandLink as the content of a column, the dataScroller of the dataTable stops to work, meaning that I need to refresh the page (F5) to see the change in the page of the dataTable.
In the first code snippet the dataScroller does not work, whereas in the second one (I just left out the commandLink) it does.
Not working:
<rich:dataTable width="600px" id="productsTable" rows="10" columnClasses="col" value="#{prodListManBean.productsList}" var="product"> <f:facet name="header"> <rich:columnGroup> <h:column> <h:outputText styleClass="headerText" value="Name" /> </h:column> <h:column> <h:outputText styleClass="headerText" value="Email" /> </h:column> <h:column> <h:outputText styleClass="headerText" value="DES Id" /> </h:column> <h:column> <h:outputText styleClass="headerText" value="Applicant" /> </h:column> <h:column> <h:outputText styleClass="headerText" value="Actions" /> </h:column> </rich:columnGroup> </f:facet> <h:column> <h:outputText value="#{product.inventedName}" /> </h:column> <h:column> <h:outputText value="#{product.receiptEmail}" /> </h:column> <h:column> <h:outputText value="#{product.desProductId}" /> </h:column> <h:column> <h:outputText value="#{product.applicant.name}" /> </h:column> <h:column> <h:commandLink action="#{prodListManBean.deleteProduct}" reRender="productsTable,productsScroller"> <h:graphicImage value="/images/icons/delete.png" width="15" height="15" alt="delete" /> <f:setPropertyActionListener target="#{prodListManBean.selectedProduct}" value="#{product}" /> </h:commandLink> </h:column> <f:facet name="footer"> <rich:datascroller align="center" for="productsTable" page="#{prodListManBean.scrollerPage}" id="productsScroller" reRender="productsTable" /> </f:facet> </rich:dataTable>
Working:
<rich:dataTable width="600px" id="productsTable" rows="10" columnClasses="col" value="#{prodListManBean.productsList}" var="product"> <f:facet name="header"> <rich:columnGroup> <h:column> <h:outputText styleClass="headerText" value="Name" /> </h:column> <h:column> <h:outputText styleClass="headerText" value="Email" /> </h:column> <h:column> <h:outputText styleClass="headerText" value="DES Id" /> </h:column> <h:column> <h:outputText styleClass="headerText" value="Applicant" /> </h:column> <h:column> <h:outputText styleClass="headerText" value="Actions" /> </h:column> </rich:columnGroup> </f:facet> <h:column> <h:outputText value="#{product.inventedName}" /> </h:column> <h:column> <h:outputText value="#{product.receiptEmail}" /> </h:column> <h:column> <h:outputText value="#{product.desProductId}" /> </h:column> <h:column> <h:outputText value="#{product.applicant.name}" /> </h:column> <h:column> </h:column> <f:facet name="footer"> <rich:datascroller align="center" for="productsTable" page="#{prodListManBean.scrollerPage}" id="productsScroller" reRender="productsTable" /> </f:facet> </rich:dataTable>