You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "Joseph Schmidt (JIRA)" <ji...@apache.org> on 2010/03/03 14:42:27 UTC
[jira] Commented: (CLK-298) Tables Should Allow Adjacent Columns To
Be Tied Together For Sorting
[ https://issues.apache.org/jira/browse/CLK-298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840657#action_12840657 ]
Joseph Schmidt commented on CLK-298:
------------------------------------
But can't be the above simply be done using a Table Decorator? Like:
http://avoka.com/click-examples/table/table-decorator.htm
but instead of having:
~~~~~~~~~~~~~~
column = new Column("date");
column.setFormat(....);
table.addColumn(column);
column = new Column("time");
column.setFormat(....);
table.addColumn(column);
~~~~~~~~~~~~~~
you would use something like:
~~~~~~~~~~~~~~
column = new Column("both");
column.setDecorator(new Decorator() {
public String render(Object row, Context context) {
Customer customer = (Customer) row;
String date = customer.getDateAsString();
String time = customer.getTimeAsString();
return date+"|"+time;
}
});
table.addColumn(column);
~~~~~~~~~~~~~~
> Tables Should Allow Adjacent Columns To Be Tied Together For Sorting
> --------------------------------------------------------------------
>
> Key: CLK-298
> URL: https://issues.apache.org/jira/browse/CLK-298
> Project: Click
> Issue Type: Improvement
> Reporter: Joel Schmidt
> Assignee: Malcolm Edgar
> Priority: Minor
>
> It would be nice to be able to "tie" together adjacent column values together in a table (e.g. date and time) for sorting purposes. Often a result set, which can otherwise be used directly as a table model has values which should be combined for sorting purposes. Without direct support for this in the Table class, the only way to achieve the result is defining a view model solely for that purpose. At best this is a programming pain, and a worst unnecessarily inefficient.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.