-
15. Re: scrollableDataTable and commandLink
alexmreis Oct 8, 2007 4:24 PM (in response to jzuccaro)Another update,
I've tried a new project with the same setup as I was using previously:
- Richfaces 3.1.1
- Sun JSF RI 1.1.02b08
- Tomcat 5.5.25
and the link works fine, even redirecting to a new page if there's a mapping to do so.
Test code follows:
home.jsp<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> </head> <body> <f:view> <h:form> <rich:scrollableDataTable var="item" id="tab" value="#{backingBean.items}" height="500px" width="100%;" rows="50" rowKeyVar="rkv" frozenColCount="0" sortMode="single"> <rich:column id="itemCol"> <f:facet name="header"> <h:outputText value="Item Number" /> </f:facet> <h:commandLink action="#{backingBean.doSomething}" value="#{item.attr} " /> </rich:column> </rich:scrollableDataTable> </h:form> </f:view> </body> </html>
BackingBean.javapackage test; import java.util.ArrayList; import java.util.List; public class BackingBean { public String doSomething(){ System.out.println("Reached the action"); return "test"; } public List<MyClass> getItems(){ ArrayList<MyClass> list = new ArrayList<MyClass>(); int current = 0; while(current < 100){ current++; list.add(new MyClass("Item " + current)); } return list; } }
faces-config.xml<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config> <managed-bean> <managed-bean-name>backingBean</managed-bean-name> <managed-bean-class>test.BackingBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <navigation-rule> <display-name>home</display-name> <from-view-id>/home.jsp</from-view-id> <navigation-case> <from-outcome>test</from-outcome> <to-view-id>/test.jsp</to-view-id> <redirect /> </navigation-case> </navigation-rule> </faces-config>
The System.out is reached, and the redirect to test.jsp works.
I wonder what is wrong with the other project? It may be that I have the hibernate libs in WEB-INF/lib... I'll try adding in hibernate to my test case and let you know -
16. Re: scrollableDataTable and commandLink
alexmreis Oct 8, 2007 4:33 PM (in response to jzuccaro)Bingo!
Adding the hibernate libraries breaks the project... now I'll try adding them one at a time to see what breaks it.
Here's a list of them:
ant-1.6.5.jar
ant-antlr-1.6.5.jar
ant-junit-1.6.5.jar
ant-launcher-1.6.5.jar
ant-swing-1.6.5.jar
antlr-2.7.6.jar
asm-attrs.jar
asm.jar
c3p0-0.9.1.jar
cglib-2.1.3.jar
checkstyle-all.jar
cleanimports.jar
commons-collections-2.1.1.jar
commons-logging-1.0.4.jar
concurrent-1.3.2.jar
connector.jar
dom4j-1.6.1.jar
ehcache-1.2.3.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-validator.jar
jaas.jar
jacc-1_0-fr.jar
javassist.jar
jaxen-1.1-beta-7.jar
jboss-archive-browsing.jar
jboss-cache.jar
jboss-common.jar
jboss-jmx.jar
jboss-system.jar
jdbc2_0-stdext.jar
jgroups-2.2.8.jar
jta.jar
junit-3.8.1.jar
log4j-1.2.11.jar
oscache-2.1.jar
proxool-0.8.3.jar
swarmcache-1.0rc2.jar
syndiag2.jar
versioncheck.jar
xerces-2.6.2.jar
xml-apis.jar
Pretty weird considering both Hibernate and Richfaces are JBoss.org projects -
17. Re: scrollableDataTable and commandLink
alexmreis Oct 8, 2007 5:52 PM (in response to jzuccaro)Ok, so here's my final list of JARs that made scrollableDataTable work with links inside it, along with Hibernate 3 and Hibernate JPA:
antlr-2.7.6.jar
asm-attrs.jar
asm.jar
cglib-2.1.3.jar
commons-beanutils.jar
commons-collections-3.2.jar
commons-digester.jar
commons-logging-1.0.4.jar
commons-modeler-2.0.1.jar
derbyclient.jar
dom4j-1.6.1.jar
ehcache-1.2.3.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-entitymanager.jar
hibernate-validator.jar
hibernate3.jar
javassist.jar
jboss-archive-browsing.jar
jboss-cache.jar
jboss-common.jar
jdbc2_0-stdext.jar
jsf-api.jar
jsf-impl.jar
jstl-1.2.jar
jta.jar
log4j-1.2.11.jar
richfaces-api-3.1.1-GA.jar
richfaces-impl-3.1.1-GA.jar
richfaces-ui-3.1.1-GA.jarantlr-2.7.6.jar
asm-attrs.jar
asm.jar
cglib-2.1.3.jar
commons-beanutils.jar
commons-collections-3.2.jar
commons-digester.jar
commons-logging-1.0.4.jar
commons-modeler-2.0.1.jar
derbyclient.jar
dom4j-1.6.1.jar
ehcache-1.2.3.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-entitymanager.jar
hibernate-validator.jar
hibernate3.jar
javassist.jar
jboss-archive-browsing.jar
jboss-cache.jar
jboss-common.jar
jdbc2_0-stdext.jar
jsf-api.jar
jsf-impl.jar
jstl-1.2.jar
jta.jar
log4j-1.2.11.jar
richfaces-api-3.1.1-GA.jar
richfaces-impl-3.1.1-GA.jar
richfaces-ui-3.1.1-GA.jar
My advice would be for you to download all apache commons jars straight from apache and discard the ones in the JSF implementations as well as the ones in hibernate, this way you get all the latest features, and they're always backwards compatible.
It seems commons-collections was the source of the problem.
Cheers,
Alex -
18. Re: scrollableDataTable and commandLink
alexmreis Oct 8, 2007 5:53 PM (in response to jzuccaro)Seems I pasted the list twice last time.
Here's the correct one:antlr-2.7.6.jar asm-attrs.jar asm.jar cglib-2.1.3.jar commons-beanutils.jar commons-collections-3.2.jar commons-digester.jar commons-logging-1.0.4.jar commons-modeler-2.0.1.jar derbyclient.jar dom4j-1.6.1.jar ehcache-1.2.3.jar ejb3-persistence.jar hibernate-annotations.jar hibernate-commons-annotations.jar hibernate-entitymanager.jar hibernate-validator.jar hibernate3.jar javassist.jar jboss-archive-browsing.jar jboss-cache.jar jboss-common.jar jdbc2_0-stdext.jar jsf-api.jar jsf-impl.jar jstl-1.2.jar jta.jar log4j-1.2.11.jar richfaces-api-3.1.1-GA.jar richfaces-impl-3.1.1-GA.jar richfaces-ui-3.1.1-GA.jar
-
19. Re: scrollableDataTable and commandLink
arielfernando Oct 9, 2007 12:53 PM (in response to jzuccaro)Good job alexmreis!!!.
I'm update all commons jars and now its working fine.
Myfaces 1.1.5
Richfaces 3.1.1
Tomahawk 1.1.6
Trinidad 1.0.3
And...
Hibernate 3.2
Spring 2.0.6
The only thing that not work 100% perfect is reRender of a Trinidad component... reRenders works fine, but, I'm lost trinidad skin / style... a minor problem.
Thanks a lot!.
Ariel. -
20. Re: scrollableDataTable and commandLink
mpics623 Dec 13, 2007 5:26 PM (in response to jzuccaro)I am having this same problem and followed this thread to try and fix. It still doesn't work. I can fix it by putting the list that i'm iterating through on the session instead of the request. but this forces me into unnecessary cleanup.
Has anyone found another solution?
<rich:scrollableDataTable id="servicesListTable"
frozenColCount="1" height="75px" width="496px" rows="0"
rendered="#{!empty appCfg.services}"
value="#{appCfg.services}" var="service" sortMode="single">
....
<rich:column width="20"
style="vertical-align:top;text-align:center">
<a4j:commandLink
actionListener="#{appCfg.setupRemove}"
immediate="true"
styleClass="imageAsLink"
reRender="servicePanel"
onclick="javascript:Richfaces.showModalPanel('mainForm:serviceDeletePanel')">
<a4j:actionparam value="#{service.id}" assignTo="#{appCfg.id}"/>
<h:graphicImage value="/app/resources/images/delete.png"/>
</a4j:commandLink>
</rich:column>
</rich:scrollableDataTable>
#{appCfg.services} is on the request. If I change the services to be on session, it is fixed. I've tried commandButton as well and it doesn't work. This example is commandLink. I'm looking for #{appCfg.setupRemove} to be called, and it never is. There is activity so the ajax submit is taking place.
HELP!