2 Replies Latest reply on Jun 2, 2010 3:14 AM by Ilya Shaikovsky

    Data scroller problems

    Omar Kanaan Newbie

      Hi everyone,

       

      I am trying to use the datascroller but it never works for me, it displays the pages as links, i can click on it but the datatable only shows the first page, here is my code

       

       

                        <rich:layoutPanel position="center" width="70%" >
                          <h:panelGrid columns="2">
                            <rich:spacer width="20"></rich:spacer>
                       <rich:tabPanel >
                         <rich:tab label="#{labels.mySuggestions}">
      <rich:dataTable value="#{pc_UserHome.userSuggestions}" rowKeyVar="row"
      var="requests" rows="10" id="table" >
      <rich:column width="75">
      <f:facet name="header">
      <h:outputText value="#{labels.requestNumber}" />
      </f:facet>
      <h:outputText value="#{requests.requestNo}" />
      </rich:column> 
      <rich:column width="175">
      <f:facet name="header">
      <h:outputText value="#{labels.requestDate}" />
      </f:facet>
      <h:outputText value="#{requests.requestDate}" >
       <f:convertDateTime dateStyle="long" timeStyle="long"/>
      </h:outputText>
      </rich:column>
      <rich:column width="400">
      <f:facet name="header">
      <h:outputText value="#{labels.subject}" />
      </f:facet>
      <a4j:commandLink value="#{requests.subject}" action="#{pc_UserHome.goToRequestDetailedView}">
       <a4j:actionparam name="requestId" value="#{requests.id}" assignTo="#{pc_UserHome.selectedId}"/> 
      </a4j:commandLink>
      </rich:column>
      <rich:column width="100">
      <f:facet name="header">
      <h:outputText value="#{labels.status}" />
      </f:facet>
      <h:outputText value="#{requests.requestStatus}" />
      </rich:column>
       
      <rich:column>
      <a4j:commandLink ajaxSingle="true" id="editlink" action="#{pc_UserHome.goToSuggestionOperation}" rendered="#{requests.editable}">
      <h:graphicImage value="../images/edit.gif" style="border:0" />
      <a4j:actionparam name="requestId" value="#{requests.id}" assignTo="#{pc_UserHome.selectedId}"/> 
      </a4j:commandLink>
      <rich:toolTip for="editlink" value="#{labels.edit}" rendered="#{requests.editable}"/>
      </rich:column>
       
      </rich:dataTable>
      <rich:datascroller for="table" />
           </rich:tab>
               <rich:tab label="#{labels.myComplaints}">
      <rich:dataTable value="#{pc_UserHome.userComplaints}" rowKeyVar="row"
      var="requests" rows="10" id="complaints" >
      <rich:column width="75">
      <f:facet name="header">
      <h:outputText value="#{labels.requestNumber}" />
      </f:facet>
      <h:outputText value="#{requests.requestNo}" />
      </rich:column> 
      <rich:column width="175">
      <f:facet name="header">
      <h:outputText value="#{labels.requestDate}" />
      </f:facet>
      <h:outputText value="#{requests.requestDate}" >
       <f:convertDateTime dateStyle="long" timeStyle="long"/>
      </h:outputText>
      </rich:column>
      <rich:column width="400">
      <f:facet name="header">
      <h:outputText value="#{labels.subject}" />
      </f:facet>
      <a4j:commandLink value="#{requests.subject}" action="#{pc_UserHome.goToRequestDetailedView}">
       <a4j:actionparam name="requestId" value="#{requests.id}" assignTo="#{pc_UserHome.selectedId}"/> 
      </a4j:commandLink>
      </rich:column>
      <rich:column width="100">
      <f:facet name="header">
      <h:outputText value="#{labels.status}" />
      </f:facet>
      <h:outputText value="#{requests.requestStatus}" />
      </rich:column>
       
      <rich:column>
      <a4j:commandLink ajaxSingle="true" id="editComplaint" action="#{pc_UserHome.goToComplaintOperation}" rendered="#{requests.editable}">
      <h:graphicImage value="../images/edit.gif" style="border:0" />
      <a4j:actionparam name="requestId" value="#{requests.id}" assignTo="#{pc_UserHome.selectedId}"/> 
      </a4j:commandLink>
      <rich:toolTip for="editComplaint" value="#{labels.edit}" rendered="#{requests.editable}"/>
      </rich:column>
       
      </rich:dataTable>
      <rich:datascroller for="complaints" />
           </rich:tab>
      </rich:tabPanel>
       </h:panelGrid>
      </rich:layoutPanel>
      
      
      

       

      and the source for the backing bean for the two functions used to retreive the tables data is as follows:

       

       

           public List<CsUserRequest> getUserSuggestions(){
                if(getCurrentUser()!=null)
                     suggestions = new UserDelegate().getUserRequests(getCurrentUser().getId(),AdnrdConstants.SUGGESTION_TYPE);
                return suggestions;
           }
           
           public List<CsUserRequest> getUserComplaints(){
                if(getCurrentUser()!=null)
                     complaints = new UserDelegate().getUserRequests(getCurrentUser().getId(),AdnrdConstants.COMPLAINT_TYPE);
                return complaints;
           }
      
       
      

       

      I would appreciate any help