Datascroller not working.
ali1983 Aug 28, 2008 5:55 PMHello to all:-
I am having a problem. rich:datascroller is not working please hellp me. I am giving the code of Bean and UI
AllCustomersBean.java
package com.pcounts.server.action.session;
import java.util.List;
import java.util.Vector;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.datamodel.DataModel;
import com.pcounts.server.hibernate.mapping.Customers;
import com.pcounts.server.hibernate.service.CustomerService;
@Stateful
@Scope(ScopeType.SESSION)
@Name("allCustomers")
public class AllCustomersBean implements AllCustomers {
@In(create = true) CustomerService customerService;
@DataModel
private List<Customers> lstCustomers;
@Factory(value = "lstCustomers")
public void listAccounts(){
Vector<Customers> v = new Vector<Customers>();
List<Customers> lstCustomer;
Long customerCount;
customerCount = customerService.getAllCustomersRowCount();
v.setSize(customerCount.intValue());
lstCustomer = customerService.getAllCustomer();
this.lstCustomers = lstCustomer;
}
@Remove
@Destroy
public void destroy(){
}
}
My UI Page
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a="http://richfaces.org/a4j">
<h:form>
<rich:dataTable value="#{lstCustomers}" var="acc" id="accs" rows="20">
<rich:column>
<f:facet name="header">
Customer Info
</f:facet>
<h:outputText value="#{acc.legalName}" />
</rich:column>
<rich:column>
<f:facet name="header">
Customer Number
</f:facet>
<h:outputText value="#{acc.customerNumber}" />
</rich:column>
</rich:dataTable>
<rich:datascroller id="rds" for="accs" maxPages="15">
</rich:datascroller>
</h:form>
</ui:composition>
Please send me the answer ASAP.
Bye
Syed Muhammad Ali Naqvi