You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alan Chaney <al...@compulsivecreative.com> on 2006/03/23 16:52:16 UTC
Creating a 'dynamic' display of tabular information using Tapestry
Hello
I am developing a web application which has a requirement that the
layout of information displayed to the user can be changed by (the)
user(s).
I've looked at the Tapestry docs and read Kent Tong's excellent book
from cover to cover.
It is a key requirement that a user (with appropriate authentication)
could log on to the system and change the way that information is displayed.
The nearest example in the book is Ch. 11 - Building Dynamic Forms. The
problem that I have is that a simple 'For' component won't do, as the
required elements of each row will be determined by the way that user
wants the data to be displayed. As far as I can see The For component
requires a static binding of elements - I want to be able to change the
way the information is rendered by information held in other tables in
the database.
Maybe a more concrete example would help explain my problem. Image there
is a database table with three pieces of text and and two images in each
record. One user could decide that when they display that table they
wish to display Text1, Text3 and Image2. The other user could want to
display all five elements. They would log on and set their preferences
which would be stored in the 'display configuration tables', and then
when they went to display the data in the table see row data displayed
as they had configured it.
Does anyone have any suggestions as to the best approach to take to
solve this problem?
Regards
Alan Chaney
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Creating a 'dynamic' display of tabular information using Tapestry
Posted by Mike Snare <mi...@gmail.com>.
I did this same thing in a demo a while back. The code is gone, but
it worked like this:
First, use contrib:Table.
For the columns attribute, call a method on the page/component
containing the table that returns an appropriate string (as defined in
the TableView components documentation) for the columns.
On the same page (or elsewhere, i guess), have a form using a
contrib:Palette that contains available columns on the left and
selected columns on the right. The order can be editable using the
Palette, if that's what you want.
The user is free to select any columns they want and then after
submitting the form the table updates because the getColumns method
uses those values to create a column string.
-Mike
On 3/23/06, Alan Chaney <al...@compulsivecreative.com> wrote:
> Hello
>
> I am developing a web application which has a requirement that the
> layout of information displayed to the user can be changed by (the)
> user(s).
> I've looked at the Tapestry docs and read Kent Tong's excellent book
> from cover to cover.
>
> It is a key requirement that a user (with appropriate authentication)
> could log on to the system and change the way that information is displayed.
>
> The nearest example in the book is Ch. 11 - Building Dynamic Forms. The
> problem that I have is that a simple 'For' component won't do, as the
> required elements of each row will be determined by the way that user
> wants the data to be displayed. As far as I can see The For component
> requires a static binding of elements - I want to be able to change the
> way the information is rendered by information held in other tables in
> the database.
>
> Maybe a more concrete example would help explain my problem. Image there
> is a database table with three pieces of text and and two images in each
> record. One user could decide that when they display that table they
> wish to display Text1, Text3 and Image2. The other user could want to
> display all five elements. They would log on and set their preferences
> which would be stored in the 'display configuration tables', and then
> when they went to display the data in the table see row data displayed
> as they had configured it.
>
> Does anyone have any suggestions as to the best approach to take to
> solve this problem?
>
> Regards
>
> Alan Chaney
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org