You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bastian Voigt <po...@bastian-voigt.de> on 2006/09/12 09:10:00 UTC

contrib:Table sorting and links

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).

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


Re: contrib:Table sorting and links

Posted by Bastian Voigt <po...@bastian-voigt.de>.
Thanks four your reply, it works now!
Must have been blind when reading the docs...
Perhaps you could add a headline like "Customized Cell Rendering"

Regards
Bastian Voigt


Re: contrib:Table sorting and links

Posted by andyhot <an...@di.uoa.gr>.
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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org