Hi Luis,

Here is a quick definition of terms:

ColumnModel - defines the columns that the table will have; it is essentially a list of ITableColumn objects, each defining a separate column. There are several standard implementations of ITableColumn, you can decide which one to use based on what you need to do. You can make your own implementation as well, but I would recommend to start with a standard implementation and extend things from there.

TableModel - contains all the information necessary to render the table. It typically contains the ColumnModel, the data (the Item[] in your case), and the table state (what column we are sorting on, what page we are on, etc).

SessionStateManager - defines what part of the TableModel will be stored in the session. For example, the entire table model can be stored in the session, or alternatively, just the table state can be stored and the data and the column model can be "recreated" at each request. This is the place where things differ from Swing, for example, since this is another paradigm (web vs. client-side). I would recommend not to use this binding at first and start with the default session state manager (the 'Full' one that stores everything) and think about optimizations later -- they can be added more or less seamlessly.

More exhaustive documentation on the Table concepts and their use can be found here: http://www.geocities.com/mindbridgeweb/TapestryTable.html

I think in your case you need to start with the very basic approach that is shown in the simple initial example -- your case is perfect for it, since you already have the data (Item[]) in an array.

Once you have this working, you can then define more complex columns that have links and other fun stuff. You can find very good examples of how to do that in the LocaleSelection component in the workbench (tutorial.workbench.table.LocaleSelection). Pay particular attention to the last two columns defined there -- verbosity and remove -- they should be good templates for what you seem to want to do.

Finally, you can turn to optimizing the session storage if there is need. You can see a relatively detailed post of mine on the topic here: http://sourceforge.net/mailarchive/message.php?msg_id=2436798

If there is still something unclear, please feel free to ask.

Best regards,

-mb

 

 Luis Neves <[EMAIL PROTECTED]> wrote:

Hello all,

I've looked at the examples of use of the Table component but I still can't
understand how to use it.
What I want to do it's simple (at least I think it's simple).
I have an array of Items (Item[]) that I would like to page like this:

********************************************************************





















Header A Header B
Item A - 1 Item A - 2
Item B - 1 Item B - 2
Item C - 1 Item C - 2







Prev   Next



********************************************************************

From the examples it's no clear to me what is the TableModel and the
ColumnModel and the Session Manager and how do I juggle with them in order do
accomplish what I want.
Any help is appreciated.
Thanks,

Luis Neves


-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Reply via email to