Check out the sweet, sweet display tag library:
http://displaytag.sourceforge.net/
Miguel Arroz <[EMAIL PROTECTED]>
05/10/2004 03:03 PM
Please respond to "Struts Users Mailing List"
To: Struts Users Mailing List <[EMAIL PROTECTED]>
cc:
Subject: Displaying a dynamic table from a collection
Hi!
I'm a newbie to Struts, and I know this is probably a very basic
question, but I'm getting REALLY confused with all the books and
documentation I have read. So, I'm asking some guidance here... I don't
need all the details, but I need some help to start.
I'm trying to make a page that, when opened (via a menu, or something
like that) displays a table with the contents of an ArrayList that
comes from the logic layer. Also, I would like to have some links and
checkboxes on each row of the table. Suppose I want this:
Name | Description | Edit | Delete
----------------------------------------------
Item 1 | Some thing | Edit me | <delete checkbox>
Item 2 | Some thing | Edit me | <delete checkbox>
Item 3 | Some thing | Edit me | <delete checkbox>
...
The "edit me" could be a link or button to another page that shows
more details about that entry, and allows the user to edit it.
My questions are:
1) How can I pass the ArrayList to the JSP page? I tried to fill in
the ActionForm of the page *before* opening the page (using the Action
that forwards to the page) but that does not work, because the form was
not yet created (it comes as null). What's the right way to do this?
2) How can I get back the checkboxes, text fields that eventually
exist on the table, and know what "Edit me" link the user clicked? I
mean, Forms as static objects relating to their properties... so there
is not a "row1", "row2", etc property on the Form object. How can I get
all the data back?
Again, i just need a push in the right direction, I do not need any
detailed stuff, although links to examples would be welcome.
Yours
Miguel Arroz
Fire, walk with me.
Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]