0 Replies Latest reply on May 27, 2008 11:05 AM by Kevin Chen

    DataScroller does not work

    Kevin Chen Newbie

      I am using richfaces-3.2.0SR1 + jsf1.2+spring+hibernate
      I saw the online demo about the <rich:datascroller>,and try to write a example by myself.Unfortunally, it doesn't work.

      web page code

      <?xml version="1.0" encoding="UTF-8" ?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:rich="http://richfaces.org/rich">
       <ui:composition>
       <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       <title>title(replace some chinese character)</title>
       </head>
       <body>
       <f:view>
       <rich:panel header="(replace some chinese character)">
       <div id=""></div>
       <h:form>
       <rich:dataTable id="expenseList" width="95%" border="0"
       value="#{expenseBeanAction.expenses}" var="expense" rows="10"
       onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column width="10px">
       <h:selectBooleanCheckbox value="" />
       </rich:column>
       <rich:column>
       <h:outputText value="(replace some chinese character)"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="(replace some chinese character)"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="(replace some chinese character)"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="(replace some chinese character)"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="(replace some chinese character)"></h:outputText>
       </rich:column>
       </rich:columnGroup>
       </f:facet>
       <rich:column>
       <h:selectBooleanCheckbox value="" />
       </rich:column>
       <rich:column>
       <h:outputText value="#{expense.expenseTime}"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="#{expense.expenseType}"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="#{expense.amountOfMoney}"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="#{expense.location}"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="#{expense.description}"></h:outputText>
       </rich:column>
       <f:facet name="footer">
       <rich:datascroller align="right" for="expenseList">
      
       </rich:datascroller>
       </f:facet>
       </rich:dataTable>
      
       </h:form>
       </rich:panel>
       </f:view>
       </body>
       </html>
       </ui:composition>
      </jsp:root>
      


      my backingBean code, the expenseService is registerd in spring bean.xml file.
      And I am sure that the expenseService works fine.

      package orz.kevin.money.finance.action;
      
      import java.util.ArrayList;
      
      public class ExpenseBeanAction {
      
       private static Log log = LogFactory.getLog(ExpenseBeanAction.class);
      
       private Expense expense;
      
       private List<Expense> expenses = new ArrayList<Expense>();
      
       private IExpenseService expenseService;
      
       public String expenseManager() {
       expenses = expenseService.getList();
       return "expenseManager";
       }
      
       public Expense getExpense() {
       return expense;
       }
      
       public void setExpense(Expense expense) {
       this.expense = expense;
       }
      
       public List<Expense> getExpenses() {
       return expenses;
       }
      
       public void setExpenses(List<Expense> expenses) {
       this.expenses = expenses;
       }
      
       public void setExpenseService(IExpenseService expenseService) {
       this.expenseService = expenseService;
       }
      
      }
      


      and my web.xml file
      <?xml version="1.0" encoding="utf-8"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
       id="money" version="2.5">
       <display-name>money</display-name>
       <!-- RichFaces Configuration -->
       <context-param>
       <param-name>org.richfaces.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>server</param-value>
       </context-param>
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.jspx</param-value>
       </context-param>
       <!-- Spring Configuration -->
       <context-param>
       <param-name>contextConfigLocation</param-name><!-- Quartz -->
       <servlet>
       <display-name>Quartz Initialzer Servlet</display-name>
       <servlet-name>QuartzInitializer</servlet-name>
       <servlet-class>
       org.quartz.ee.servlet.QuartzInitializerServlet
       </servlet-class>
       <init-param>
       <param-name>config-file</param-name>
       <param-value>quartz.properties</param-value>
       </init-param>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <param-value>
       /WEB-INF/classes/applicationContext-properties.xml
       /WEB-INF/classes/applicationContext-dao.xml
       /WEB-INF/classes/applicationContext-dataSource.xml
       /WEB-INF/classes/applicationContext-quartzBase.xml
       /WEB-INF/classes/applicationContext-quartzDao.xml
       /WEB-INF/classes/applicationContext-service.xml
       </param-value>
       </context-param>
       <context-param>
       <param-name>webAppRootKey</param-name>
       <param-value>money</param-value>
       </context-param>
       <!-- setup log4j configuration -->
       <context-param>
       <param-name>log4jConfigLocation</param-name>
       <param-value>/WEB-INF/classes/log4j.properties</param-value>
       </context-param>
       <!-- RichFaces Configuration -->
       <filter>
       <display-name>RichFaces Filter</display-name>
       <filter-name>richfaces</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>richfaces</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       </filter-mapping>
       <!-- Quartz -->
       <servlet>
       <display-name>Quartz Initialzer Servlet</display-name>
       <servlet-name>QuartzInitializer</servlet-name>
       <servlet-class>
       org.quartz.ee.servlet.QuartzInitializerServlet
       </servlet-class>
       <init-param>
       <param-name>config-file</param-name>
       <param-value>quartz.properties</param-value>
       </init-param>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <!-- JSF Configuration -->
       <listener>
       <listener-class>
       com.sun.faces.config.ConfigureListener
       </listener-class>
       </listener>
       <!-- Spring Configuration -->
       <listener>
       <listener-class>
       org.springframework.web.util.IntrospectorCleanupListener
       </listener-class>
       </listener>
       <listener>
       <listener-class>
       org.springframework.web.util.Log4jConfigListener
       </listener-class>
       </listener>
       <listener>
       <listener-class>
       org.springframework.web.context.ContextLoaderListener
       </listener-class>
       </listener>
       <!-- setup encoding configuration -->
       <filter>
       <filter-name>encodingFilter</filter-name>
       <filter-class>
       org.springframework.web.filter.CharacterEncodingFilter
       </filter-class>
       <init-param>
       <param-name>encoding</param-name>
       <param-value>UTF-8</param-value>
       </init-param>
       <init-param>
       <param-name>forceEncoding</param-name>
       <param-value>true</param-value>
       </init-param>
       </filter>
       <!-- Spring-Hibernate Configuration -->
       <filter>
       <filter-name>hibernateFilter</filter-name>
       <filter-class>
       org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
       </filter-class>
       </filter>
       <!-- Faces Servlet -->
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <!-- Faces Servlet Mapping -->
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.jsf</url-pattern>
       </servlet-mapping>
       <login-config>
       <auth-method>BASIC</auth-method>
       </login-config>
       <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
       </welcome-file-list>
      
      </web-app>