4 Replies Latest reply on Aug 4, 2010 4:37 AM by Ilya Shaikovsky

    What is wrong with datascroller

    kks_krishna Newbie

      I am explaining the problem here:

      I have added datascroller above the datatable and it shows 4 pgaes with link. When I click on the link 2 it is not updating the rows. That means only first time it is loaded with default first page data. After that not reteriving the data for subsequent pages. Please look into the following code:

      <rich:panel style="margin-top:10;">
       <rich:datascroller for="dc_list"/>
       <rich:dataTable var="sys"
       value="#{clinicalDetailsBean.doctorsAppointment}" id="dc_list"
       rows="2" width="500">
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column>
       <h:outputText value="Doctor" />
       </rich:column>
       <rich:column>
       <h:outputText value="Dates" />
       </rich:column>
       </rich:columnGroup>
       </f:facet>
       <rich:column colspan="2">
       <h:commandLink value="#{sys.firstName}"/>
       </rich:column>
       <rich:subTable value="#{sys.availableDates}" var="sys1">
       <rich:column colspan="2" style="text-align:right;">
       <h:commandLink value="#{sys1}"/>
       </rich:column>
       </rich:subTable>
       </rich:dataTable>
       </rich:panel>


        • 1. Re: What is wrong with datascroller
          Adrian Mitev Master

          jsf version?

          • 2. Re: What is wrong with datascroller
            kks_krishna Newbie

            I resolved the problem. added subset inside h:column

            • 3. Re: What is wrong with datascroller
              Baran Seil Sepour Newbie

              Hi

              I am new in richfaces.I have problem with datascroller.

              I have one class named State:

               

              public class State {
                  private String name;
                  private String capital;
                  private String flagImage;
                  public State(String name, String capital, String flagImage){
                      this.setName(name);
                      this.setCapital(capital);
                      this.setFlagImage(flagImage);
                  }
                  public void setName(String name) {
                      this.name = name;
                  }
                  public String getName() {
                      return name;
                  }
                  public void setFlagImage(String flagImage) {
                      this.flagImage = flagImage;
                  }
                  public String getFlagImage() {
                      return flagImage;
                  }
                  public void setCapital(String capital) {
                      this.capital = capital;
                  }
                  public String getCapital() {
                      return capital;
                  }
              }
              

              and I have one jsp page like this:

               

              <body>
              <f:view>
              
              <h:form>
              
              
              -----------------------DATA TABEL-----------------
              <rich:dataTable value="#{backingBean7.stateList}" var="state" id="statesTable1" rows="3">
                        
                     
                        <h:column>
                     <f:facet name="header">State</f:facet>
                     <h:outputLabel value="#{state.name}"></h:outputLabel>
                        </h:column>
                        
                    </rich:dataTable>
                     <h:panelGrid style="text-align: left">
                      <rich:datascroller for="statesTable1" maxPages="2"
                      selectedStyle="font-weight:bold" />
                  </h:panelGrid>
              -----------------------DATA LIST------------------
              <rich:panel>
                  <f:facet name="header">
                  Using rich:datascroller
                  </f:facet>
                  <rich:dataList id="statesTable2"
                      value="#{backingBean7.stateList}" var="state" rows="3" >
                     <h:outputLabel value="#{state.name}"></h:outputLabel>
                      </rich:dataList>
              
                  <h:panelGrid style="text-align: left">
                      <rich:datascroller for="statesTable2" maxPages="2"
                      selectedStyle="font-weight:bold" />
                  </h:panelGrid>
              </rich:panel>
              ---------------------DATA DEFINITION------------------
              <rich:panel>
                  <f:facet name="header">
                  Using rich:datascroller
                  </f:facet>
                  <rich:dataDefinitionList id="statesTable3"
                      value="#{backingBean7.stateList}" var="state" rows="3">
                      <h:outputLabel value="#{state.name}"></h:outputLabel>
                     </rich:dataDefinitionList>
                 <h:panelGrid style="text-align: left">
                     <rich:datascroller for="statesTable3" maxPages="2"
                     selectedStyle="font-weight:bold"/>
                 </h:panelGrid>
              </rich:panel>
              </h:form>
              </f:view>
              </body>
              

              In my backing bean, stateslist will be initialized in init() method like this:

              stateList = new ArrayList<State>();
                  stateList.add(new State("11", "111", "11111"));
                  stateList.add(new State("22", "222", "22222"));
                  stateList.add(new State("33", "333", "33333"));
                  stateList.add(new State("44", "444", "44444"));
                  stateList.add(new State("55", "555", "55555"));
                  stateList.add(new State("66", "666", "66666"));
                  stateList.add(new State("77", "777", "77777"));
                  stateList.add(new State("88", "888", "88888"));
                  stateList.add(new State("99", "999", "99999"));

               

               

              In my datatable, when I click on page numbers, datatable will not be updated(no action, no upfate), and in my datalist and datadefinitionlist, when I go to page 2 or 3 or..., records from page 1 will be added to other records.

              Is there any special configuration or setting that I should insert in my web.xml or facesconfig?

              I need help

              • 4. Re: What is wrong with datascroller
                Ilya Shaikovsky Master

                check please if there are any exceptions in server log or  client side problem logged in a4j:log.