4 Replies Latest reply on Jun 26, 2009 7:41 AM by Ilya Shaikovsky

    Weird behaviour of rich:datascroller

    rajesha Indurthi Newbie

      Hi there,
      I have this weird behaviour when I use rich:datascroller. Iam using the datascroller along with my rich:datatable formy page navigation. My page navigation works fine, however when I navigate to the next page sometimes a4j:commandLinks which are columns in my datatable dont work as expected. On clicking the a4j command links should take me to anew view, this does not happen when I navigate to the next page using datascroller.


      <rich:datascroller id="dataScroller" renderIfSinglePage="false" immediate="true" for="searchresults" maxPages="5"/>
      
      
      
      <rich:dataTable style="border-bottom-width:1px;" value="#{SEARCH_RESULTS}" var="hit" id="searchresults" rendered="#{SEARCH_RESULTS != null && not empty SEARCH_RESULTS_SIZE}"
       headerClass="center" width="100%" binding="#{searchResultsBean.data}" rows="20" cellpadding="0" cellspacing="0">
      
       <h:column>
       <h:panelGrid columns="3" id="searchResultsTable" width="100%" columnClasses="dataTableColumn1,dataTableColumn2,dataTableColumn3" cellpadding="0" cellspacing="0">
      
       <rich:panel style="border:0px;margin:0px" id="checkBoxPanel">
       <h:selectBooleanCheckbox value="#{hit.selected}" id="selectBox" style="align:center" />
       </rich:panel>
      
       <rich:panel style="border:0px;margin:0px" id="identPanel">
       <h:outputText style="font-weight:bold" value="This is a No-Hit File" rendered="#{hit.noHit}" id="hitNohit" />
      
       <h:panelGrid columns="1" id="identGrid">
       <a4j:commandLink action="#{searchResultsBean.displayDetails}" immediate="true" id="displayDetailsLink">
       <h:outputText value="#{hit.lastName}," style="margin-right:1px;font-size:xx-small" id="lastName" />
       <h:outputText value="#{hit.firstName}" style="font-size:xx-small" id="firstName" />
       </a4j:commandLink>
       </h:panelGrid>
       </rich:panel>
      
      ....
      ....
      ...
      
      </rich:dataTable>



      My datascroller and the data table code snippets are as shown above and the above a4j:commandLin's action is not being called when I navigate to the next page and try to click this link from that page. Please let me know what is happening here. without the a4j:datascroller my links in thedata table appear to work just fi ne. Any help in this is highly appreciated. Thanks in advance


        • 1. Re: Weird behaviour of rich:datascroller
          Remi Guillemette Newbie

          Hi,

          You should not use a4j:commandLink to navigate to another page. Use standard commandLink instead or a4j:htmlCommandLink.

          @+

          • 2. Re: Weird behaviour of rich:datascroller
            rajesha Indurthi Newbie

            Hi,
            Thanks for teh help that works

            • 3. Re: Weird behaviour of rich:datascroller
              rajesha Indurthi Newbie

              Hi there,

              Another quick question regarding the rich:datascroller, Iam trying to use the action attribute in the datascroller, I see in the tld documentation that this component has a action attribute , how ever I get the following error :


              6/25/09 16:25:22:845 EDT] 00000024 WebApp E [Servlet Error]-[Faces Servlet]: java.lang.IllegalArgumentException: Component dataScroller is no ActionSource
               at org.ajax4jsf.framework.taglib.UIComponentTagBase.setActionProperty(UIComponentTagBase.java:305)
               at org.richfaces.taglib.DatascrollerTag.setProperties(DatascrollerTag.java:629)
               at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1021)
               at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1040)
               at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:753)
               at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:433)
               at com.ibm._jsp._searchResults._jspx_meth_rich_datascroller_0(_searchResults.java:926)
               at com.ibm._jsp._searchResults._jspx_meth_h_panelGroup_5(_searchResults.java:948)
               at com.ibm._jsp._searchResults._jspx_meth_h_panelGrid_0(_searchResults.java:979)



              my data scroller code snippet is :


              <rich:datascroller id="dataScroller" renderIfSinglePage="false" reRender="searchResultsPanel" immediate="true" for="searchresults" maxPages="5"/>



              What is that Iam doing wrong here....and why is it complaining that it does not have an action method, Iam using richFaces 3.0 with JSF sun RI 1.1. Did something change over time



              • 4. Re: Weird behaviour of rich:datascroller
                Ilya Shaikovsky Master

                too old version seems the reason.