3 Replies Latest reply: Jan 11, 2010 5:12 PM by Nick Belaevski RSS

commandLink in dataTable stops dataScroller from working

Markos Fragkakis Newbie

In 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>
  • 1. Re: commandLink in dataTable stops dataScroller from working
    Nick Belaevski Master

    Hi,

     

    How does bean code look like?

  • 2. Re: commandLink in dataTable stops dataScroller from working
    Markos Fragkakis Newbie

    I did this to work around it:

     

    <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>
    
    
  • 3. Re: commandLink in dataTable stops dataScroller from working
    Nick Belaevski Master
    Please add a4j:log to the page and check if there are errors.