You can use the nested tags from keyboardmonkey as you had asked in another post to 
solve this issue.  Note that due to outside limitations the nested tags with Struts 
1.0.2 require you to provide an Object[] (as opposed to a Collection) to iterate over 
a collection.  Your example with Participant[] array *should* work.

Sri

> -----Original Message-----
> From: Alex [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, December 04, 2002 5:26 PM
> To: [EMAIL PROTECTED]
> Subject: Best "indexed reference/nested bean" alternative for 
> Struts 1.0.2 app?
> 
> 
> I have a requirement to implement a JSP with a certain look 
> and feel in an existing pseudo Struts 1.0.2 application. The 
> rendered HTML would have this approximate look (assuming the 
> last action was the user clicking the Add Participant button 
> to add the new row with the "type here" placeholder
> text):
> 
> ***********************************************
>   Event Title:  {SOME EVENT}
>   Event Location:  {SOME LOCATION}
>   ------------------------------------------------------------
>   Event Participants:
>     Remove     Name                                       Vegetarian
>          X         {FIRST PARTICIPANT}               X
>          X         {SECOND PARTICIPANT}          X
>          X         {Type Name Here}                          X
> 
>   [Add Participant]   [Remove Participant(s)]
>   ------------------------------------------------------------
>                             [Save]   [Cancel]
> ***********************************************
> 
> The "{ }" indicate HTML text controls, the "X" HTML 
> checkboxes and the "[ ]" HTML submit buttons. The business 
> requirements specify being able to edit the "child level" 
> bean properties on the same HTML page as several "parent 
> level" ActionForm properties.
> 
> The ActionForm and Participant bean have these approximate 
> implementation:
> 
> public class EventForm
> extends ActionForm {
>     private String title;
>     private String location;
>     private Participant [] participants;
>     <snip>
> }
> 
> public class Participant {
>     private String name;
>     private Boolean isVegetarian;
>     <snip>
> }
> 
> Actually the look and feel is much more complicated as is the 
> ActionForm. Struts 1.1 has support for indexed references and 
> nested bean taglibs which would make this easier/cleaner (at 
> least this appears to be the case in my interpretation of 1.1 
> enhancements). Unfortunately, 1.0.2 does not support these 
> features and I'm not finding too many examples to learn from. 
> What is the best way to implement a "nested" JSP form like 
> this in Struts 1.0.2?
> 
> The previous implementers accomplished this type of user 
> interface in other parts of the web app by avoiding 
> ActionForms in favor of lots of JSP scriplets and explicit 
> request parsing in the Action. I'd like to get away from that 
> and use as many Struts-isms as practical to make the eventual 
> migration to 1.1 easier.
> 
> Thanks,
> - Alex
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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

Reply via email to