-
1. Re: sorting is not working in the richfaces custom DataTable
kanal Sep 23, 2010 5:59 AM (in response to gana)Refer to http://richfaces-showcase-gae.appspot.com/richfaces/component-sample.jsf?sample=tableSorting&demo=dataTable&skin=deepMarine to see how sorting is implemented in RF 4.x.
Also please read the discussion about dataTables features in richfaces version 4.x
-
2. Re: sorting is not working in the richfaces custom DataTable
konstantin.mishin Sep 24, 2010 11:35 AM (in response to gana)There is not enough information to help you. When you ask some question, describe your environment, in particular RF version. Post full code of table initialization also.
-
3. Re: sorting is not working in the richfaces custom DataTable
gana Sep 28, 2010 4:45 AM (in response to konstantin.mishin)Hi,
Sorry for that. Actually we are developing new webUI framework on top of jsf and richfaces. As part of that we are developing our custom dataTable. So our requirement is that we should implement sorting functionality to our datatable. So In my table user will give EL expression for loading the data and if user specifies sorting is true then my table has to do sorting functionality. So my code looks like this.
for (int i = 1; i <= columns; i++) {
HtmlOutputText header = new HtmlOutputText();
header.setValue("header" + i);
col = new HtmlColumn();
col.setId("col" + i);
col.setHeader(header);
expression = factory.createValueExpression(elcontext, "#{row[" + (i - 1)+ "]}", String.class);
body = new HtmlOutputText();
body.setValueExpression("value", expression);
col.getChildren().add(body);
col.setSortable(true);
col.setSortIcon("/webuif/images/ascending.gif");
col.setSortIconAscending("/webuif/images/ascending.gif");
col.setSortIconDescending("/webuif/images/descending.gif");
col.setValueExpression("sortBy",factory.createValueExpression(elcontext, "#{row[" + (i - 1)+ "]}", String.class));
getChildren().add(col);}
So now my table header became sortable and even when i click on the header AJAX.Submit() method also calling when i see in the firebug. But data is not sorting and sorting arrows are also not changing.
Please let me know if any thing required.
Br,
Gana