0 Replies Latest reply on Aug 26, 2011 3:08 AM by anu ranjitha

    rich:dataScroller is not working

    anu ranjitha Newbie

      Hi,

       

      I am using RichFaces 4.0.0.Final version. Based on the search parameters (FirstName, LastName, UserName, Email and Status), need to render a table with data scroller. Showing data scroller above the table (outside of the table).

       

      For first click on search button my data table and data scrollers are rendering perfect.

      For the second click table is rendering but data scroller is not rendering.

      Again for the third click both are rendering, If I do again data scroller is not rendering.

       

      Data scroller is rendering by alternate clicks.

       

      Calculating the no of pages in managed bean.  And scope of the bean is @ViewScoped.

       

      Here I am attaching my code snippet..

       

      <!-- SEARCH PANEL -->

      <h:panelGrid id="quickSearchPanel" columns="5"

                  styleClass="table.mangeusertoptbl" style="width:670px;">

                  <h:outputLabel value="#{samp.lastname}:" />

                  <h:inputText value="#{searchBean.lastName}" type="text" id="lastname"

                      size="15" />

                  <h:outputLabel value="#{samp.username}:" />

                  <h:inputText value="#{searchBean.userName}" type="text" id="username"

                      size="15" />

                  <h:panelGrid columns="2">

                      <h:outputLabel value="#{samp.status}:" />

                      <h:selectOneMenu id="status" value="#{searchBean.status}">

                          <f:selectItems value="#{searchBean.statusList}" />

                      </h:selectOneMenu>

                  </h:panelGrid>

                  <h:outputLabel value="#{samp.firstname}:" />

                  <h:inputText value="#{searchBean.firstName}" type="text"

                      id="firstname" size="15" />

                  <h:outputLabel value="#{samp.manageUserEmail}:" />

                  <h:inputText value="#{searchBean.email}" type="text" id="email"

                      size="15">

                  </h:inputText>

                  <h:panelGrid columns="2">

                      <a4j:commandButton value="#{uit.search}"

                          action="#{searchBean.getSearchResult}"

                          render="userTable,userdataScroller" styleClass="red_btn" />

                      <h:commandButton value="#{uit.clear}"

                          action="#{searchBean.setDefaultValues}" styleClass="grey_btn" />

                  </h:panelGrid>

      </h:panelGrid>

       

      <!-- PAGINATION -->

      <rich:dataScroller id="userdataScroller" for="userTable"

                      maxPages="#{searchBean.noOfPages}" fastControls="hide" >

                      <f:facet name="first">

                          <h:outputText value="First" styleClass="scrollerCell" />

                      </f:facet>

                      <f:facet name="first_disabled">

                          <h:outputText value="First" styleClass="scrollerCell" />

                      </f:facet>

                      <f:facet name="last">

                          <h:outputText value="Last" styleClass="scrollerCell" />

                      </f:facet>

                      <f:facet name="last_disabled">

                          <h:outputText value="Last" styleClass="scrollerCell" />

                      </f:facet>

                      <f:facet name="previous">

                          <h:outputText value="Previous" styleClass="scrollerCell" />

                      </f:facet>

                      <f:facet name="previous_disabled">

                          <h:outputText value="Previous" styleClass="scrollerCell" />

                      </f:facet>

                      <f:facet name="next">

                          <h:outputText value="Next" styleClass="scrollerCell" />

                      </f:facet>

                      <f:facet name="next_disabled">

                          <h:outputText value="Next" styleClass="scrollerCell" />

                      </f:facet>

      </rich:dataScroller>

       

      <!-- DATA TABLE -->

      <rich:dataTable id="userTable" rows="#{prod.noOfRowsPerPage}"

                  value="#{searchBean.usersList}" var="userData"

                  rowClasses="tableOddRow,tableEvenRow" styleClass="case-list"

                  width="75%" headerClass="iceTblHeader" render="userdataScroller">

       

                  <rich:column>

                      <f:facet name="header">

                          #{userData.username}

                      </f:facet>

                      <h:outputText value="#{userData.username}" />

                  </rich:column>

       

                  <rich:column>

                      <f:facet name="header">

                          #{userData.lastname}

                      </f:facet>

                      <h:outputText value="#{userData.lastname}" />

                  </rich:column>

       

                  <rich:column>

                      <f:facet name="header">

                          #{userData.firstname}

                      </f:facet>

                      <h:outputText value="#{userData.firstname}" />

                  </rich:column>

                 

                  <rich:column>

                      <f:facet name="header">

                          #{userData.emailAddress}

                      </f:facet>

                      <h:outputText value="#{userData.emailAddress}" />

                  </rich:column>

       

                  <rich:column>

                      <f:facet name="header">

                          #{samp.status}

                      </f:facet>

                      <h:outputText value="#{samp.Active}" rendered="#{userData.active}" />

                      <h:outputText value="#{samp.Inactive}" rendered="#{!userData.active}" />

                  </rich:column>

      </rich:dataTable>