The stock JSF datatable control doesn't support column sorting. You'll need an extended datatable control like the one that Tomahawk provides.
Of course if you're talking a LARGE collection such as a view into a database that's going to span multiple display pages, the rules are different, because at that level, you should have used a SQL with ordering.
An IDE is no substitute for an Intelligent Developer.
posted 10 years ago
I have tried using Tomohawk 1.1.3 along with myfaces-impl-1.1.4 and myfaces-api-1.1.4 but it does not solve my issue. The issue being trying to use <t:dataTable to work with JSF 1.1 so that I could sort the list and provide the user with a capability of sorting when they click any header on the list.
The issues I have been facing is :
1)using Tomahawk 1.1.3,myfaces-impl-1.1.4,myfaces-api-1.1.4 instead of Tomahawk 1.0 screws up my existing application i.e I keep getting application error. I cannot chase those error because they are far too many and it would be time consuming to fix those than get the sorting feature working.
2) Using <display:table the issue is that say I have 3 JSPs namely
A.jsp , B.jsp , C.jsp
A.jsp is the main page and B.jsp, C.jsp are tabbed pane ( using <corejsf:tabpane> tag ) .
To get the <display:table to render in B.jsp and C.jsp it says you need to wrap it in a <h:form > </h:form>. I wrapped the whole information in B.jsp with the <h:form > </h:form> tag, when i click either the C tab or click the B tab I get the following error msg :
TabInfo.MainInfo.TabPaneNew in null or not an object
I know we cannot use a <h: form > within a <h:form> but how could i get this working?
Try JBoss Richface JSF component. It has a lot of cool components to use. Here is the site for all component demo: http://livedemo.exadel.com/richfaces-demo/index.jsp Expand the Data Iteration panel on the left and the last example is for data sorting. A simple tag attribute will bring in the sort icon on the screen and also sort the data based on the field you mention. Be little careful to select the Richface version if you are downloading it. The latest 3.2 works with JSF 1.2. Download any of the previous versions.
Thanks,<br />Sudipto<br /> <br />"Build the Java Community"