Re: Struts - How to recover collection element

2004-06-24 Thread Bill Siggelkow
I think I am not grokking your complete workflow, however, you said in your first post: "Once a user selects an option, the option value (rather than the description) is recorded in a form bean, and the form bean is forwarded to another form." So, the 'key' is the value that the user picked fro

Re: Struts - How to recover collection element

2004-06-23 Thread jthompson
Superb answer Bill. I've coded the following which correctly gets the OptionsCollection, but I'm stumped as to what to substitute in place of 'MyForm.key': Type: There are a couple of ways o

Re: Struts - How to recover collection element

2004-06-23 Thread Bill Siggelkow
There are a couple of ways of doing this. I think the best approach is to wrap your collection in a JavaBean that is stored in the session. Something like the following: public class OptionsHolder { Map options = new HashMap(); public OptionsHolder() { options.put("key1", new LabelValueB