This content has been marked as final.
Show 6 replies
-
1. Re: rich:dataTable not sorting Integer
mvitenkov May 20, 2008 8:31 AM (in response to james.holder3)Could you please attach your source code(or .war) with implemented sorting feature & describe your configuration(server, browser, OS, platform)?
This bug isn't reproducible under 3.2.1.CR5 for test-application. -
2. Re: rich:dataTable not sorting Integer
james.holder3 May 20, 2008 11:12 AM (in response to james.holder3)"mvitenkov" wrote:
Could you please attach your source code(or .war) with implemented sorting feature & describe your configuration(server, browser, OS, platform)?
This bug isn't reproducible under 3.2.1.CR5 for test-application.
Certainly:
Weblogic 10
IE6
WinXP
3.2.1.CR5 (dl'ed from http://repository.jboss.org/maven2/org/richfaces/ui/richfaces-ui/3.2.1.CR5/)
Facelets 1.1.14
Spring
Like I said, the table is sortable (and sorts) on all the columns, the only issue is the id field (the Integer), sorts like a string. for instance I see:
0
1
10
100
101
when sorting the id column.
Thanks for your help.
Bean:public class JamesBean implements Serializable{ public class TestObject{ private String firstName; private String lastName; private Integer id; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } } private List<TestObject> names; public List<TestObject> getNames() { if(this.names==null){ this.names = new ArrayList(); for(int i=0;i<500;i++){ TestObject to = new TestObject(); to.setId(i); to.setFirstName("First:"+i); to.setLastName("Last:"+i); this.names.add(to); } } return names; } }
JSP Code:<h:form id="viewReportForm"> <rich:dataTable var="item" value="#{James.names}" id="reportItemsTable" sortMode="single" > <rich:column sortBy="#{item.id}" id="ID"> <f:facet name="header"> <h:outputText value="id" /> </f:facet> <h:outputText value="#{item.id}"/> </rich:column> <rich:column sortBy="#{item.firstName}" id="firstName"> <f:facet name="header"> <h:outputText value="First Name" /> </f:facet> <h:outputText value="#{item.firstName}"/> </rich:column> <rich:column sortBy="#{item.lastName}" id="lastName"> <f:facet name="header"> <h:outputText value="Last Name" /> </f:facet> <h:outputText value="#{item.lastName}"/> </rich:column> </rich:dataTable> </h:form>
Spring Bean Definition:<bean id="James" scope="session" class="path.to.my.beans.managedBeans.JamesBean"/>
-
3. Re: rich:dataTable not sorting Integer
meurisse May 23, 2008 11:06 AM (in response to james.holder3)0
1
10
100
101
is sorted correctly, not?
But it is not a good example, a string sort would give the same...
A better example (string sorted):
0
1
10
2
I'm curious to know from you if it works, cause I'm waiting for the fix too... -
4. Re: rich:dataTable not sorting Integer
meurisse May 27, 2008 9:00 AM (in response to james.holder3)Looks like it is fixed: http://jira.jboss.com/jira/browse/RF-2915
-
5. Re: rich:dataTable not sorting Integer
rajarchu Jul 24, 2008 7:48 PM (in response to james.holder3)Hi am also facing the same problem. I am using 3.2.0.SR version and i dont know how to slove this.. any one has any idea?
-
6. Re: rich:dataTable not sorting Integer
rajarchu Jul 24, 2008 8:22 PM (in response to james.holder3)Got the problem solved in 3.2.1.GA version. I am able to sort accroding to data types. Thanks