Thursday, August 29, 2002 05:19 PM
You will need to do something like this.
Notice that the select tag has a "myPreselectedItemBean" bean associated with it, this bean must be in some scope ie. session, request etc..
The same goes for the "myCollection" bean, this is a bit more complex. Took me a while to get my head around...
"myCollection" should be either be an Object extending java.util.Collection or an array of Objects. It can't be a simple type (eg. int).
"myCollection" should be made up of other beans, with a getMyValue() and getMyLabelProperty() method.
public class OptionItem
public String getMyValue()
public void setMyValue(String myValue)
this.myValue = myValue;
public String getMyLabel()
public void setMyLabel(String myLabel)
this.myLabel = myLabel;
I normally create a Vector and then populate it with these sort of beans.
I hope this is helpful to you.