Bastian Voigt wrote:
> Hello List,
>
> currently I'm trying to make a sortable table based on an O/R Mapper
> backend.
>
> Until now I was using my own "IBasicTableModel" implementation which
> allowed to get results fast. However, it does not allow to sort
> columns (sorting has no effect) and it also does not allow to display
> links in the table rows (I want to link to a details page from each
> row in the table).
But it does allow all these...
- You have to implement sorting yourself which is nice & efficient cause
you can have the db do it for you.
Take a look at the javadocs for IBasicTableModel
http://tapestry.apache.org/tapestry4/tapestry-contrib/apidocs/org/apache/tapestry/contrib/table/model/IBasicTableModel.html
When getCurrentPageRows is called, it includes a sortColumn and a
sortOrder parameter... make your implementation use it.
Values for sortOrder are ITableSortingState.SORT_ASCENDING and
SORT_DESCENDING

- Why can't you display links in the table rows? In the Table component,
are you using the source and columns parameters ?
From
http://tapestry.apache.org/tapestry4/tapestry-contrib/ComponentReference/Table.html
:
' If defined, a Block with a name that starts with the column id and
ends with /ColumnValue/ will be used to render the column values.
Similarly, a Block with a name that starts with the column id and ends
with /ColumnHeader/ will be used to render the column headers.'
If you define those Blocks, you can override how each cell renders itself.

There's an example in
http://tapestry.apache.org/tapestry3/doc/ComponentReference/contrib.Table.html



>
> I think I will have to implement my own ITableModel, right? Perhaps
> there is a tutorial somewhere or something? I have no clue how to do
> it because of the large number of classes and interfaces involved
> (ITableModel, ITableColumnModel, ITableSortingState,
> ITablePagingState, ITableColumn, ITableModelSource, etc.)
>
>
> Please point me to some documentation!
>
> Thanks
> Bastian
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to