RE: select/options/option
Hi Jason, As a matter of fact, I was going to add that. Now I have reason to. Thank you. :-) -- Larry Select can be used with: a: A collection of strings, such as an arraylist b: A collection of beans, each of which has string fields c: Hard coded values I know you can combine a and c, as well as b and c. I'm guessing you could combine a, b, and c as well. With An ArrayList of Strings ArrayList name is nameList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. html:select property=selectedValue html:options name=nameList / /html:select How to Set a Selected Value --- Modify select as follows: html:select property=selectedValue value=aName html:options name=nameList / /html:select where aName is one of the names in the arrayList. With An ArrayList of Beans -- Bean string fields of interest are: 1. displayValue 2. idValue ArrayList name is beanList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. It should be set to the idValue of the selected bean. html:select property=selectedValue html:options collection=nameList property=idValue labelProperty=displayValue/ /html:select How to Set a Selected Value --- Modify select as follows: html:select property=selectedValue value=aProperty html:options collection=nameList property=value labelProperty=longName/ /html:select where aProperty is one of the strings in the field of the bean specified by property in the options tag. With HardCoded Values - name of field in form bean to set is selectedValue. html:select property=selectedValue html:option value=value_1/ html:option value=value_2/ html:option value=value_3/ /html:select How to Set a Selected Value --- Modify select as follows: html:select property=selectedValue value=value_2 html:option value=value_1/ html:option value=value_2/ html:option value=value_3/ /html:select -Original Message- From: Jason Wells [mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 5:49 PM To: Struts Users Mailing List Subject: Re: select/options/option Thanks for the summarized info. Using the html:option tag, is there a way to set an option to be initially selected? I'm looking for something equivalent to option value=blah selectedblah/option I don't see mention of this in the online docs for the HTML taglib. Thanks, Jason Larry Maturo wrote: Since I see these questions come up, and I just got them figured out, I thought I would share them with the mailing list. Select can be used with: a: A collection of strings, such as an arraylist b: A collection of beans, each of which has string fields c: Hard coded values I know you can combine a and c, as well as b and c. I'm guessing you could combine a, b, and c as well. With An ArrayList of Strings ArrayList name is nameList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. html:select property=selectedValue html:options name=nameList / /html:select With An ArrayList of Beans -- Bean string fields of interest are: 1. displayValue 2. idValue ArrayList name is beanList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. It should be set to the idValue of the selected bean. html:select property=selectedValue html:options collection=nameList property=idValue labelProperty=displayValue/ /html:select With HardCoded Values - name of field in form bean to set is selectedValue. html:select property=selectedValue html:option value=value_1/ html:option value=value_2/ html:option value=value_3/ /html:select -- Larry Maturo [EMAIL PROTECTED] Athens Group, Inc. -- Jason Wells Web Architect Xsilogy, Inc. http://www.xsilogy.com/ -- To unsubscribe, e-mail: mailto:[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]
Re: select/options/option
Hello, On Fri, 11 Jan 2002 15:48:31 -0800 Jason Wells [EMAIL PROTECTED] wrote: Using the html:option tag, is there a way to set an option to be initially selected? I'm looking for something equivalent to option value=blah selectedblah/option I don't see mention of this in the online docs for the HTML taglib. This can be done by initializing the form-bean with the value you'd like to be selected by default. Very nice indeed. Bye, MM -- http://www.martinnet.de -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: select/options/option
The value which is returned from the property property in the select tag will make the choice for you if one of the choices matches this value. eg. Use the options tag running off a list, and if the property which is specified in the select tag matches one, Struts will select it for you. Arron. Jason Wells wrote: Thanks for the summarized info. Using the html:option tag, is there a way to set an option to be initially selected? I'm looking for something equivalent to option value=blah selectedblah/option I don't see mention of this in the online docs for the HTML taglib. Thanks, Jason Larry Maturo wrote: Since I see these questions come up, and I just got them figured out, I thought I would share them with the mailing list. Select can be used with: a: A collection of strings, such as an arraylist b: A collection of beans, each of which has string fields c: Hard coded values I know you can combine a and c, as well as b and c. I'm guessing you could combine a, b, and c as well. With An ArrayList of Strings ArrayList name is nameList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. html:select property=selectedValue html:options name=nameList / /html:select With An ArrayList of Beans -- Bean string fields of interest are: 1. displayValue 2. idValue ArrayList name is beanList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. It should be set to the idValue of the selected bean. html:select property=selectedValue html:options collection=nameList property=idValue labelProperty=displayValue/ /html:select With HardCoded Values - name of field in form bean to set is selectedValue. html:select property=selectedValue html:option value=value_1/ html:option value=value_2/ html:option value=value_3/ /html:select -- Larry Maturo [EMAIL PROTECTED] Athens Group, Inc. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: select/options/option
Thanks for the summarized info. Using the html:option tag, is there a way to set an option to be initially selected? I'm looking for something equivalent to option value=blah selectedblah/option I don't see mention of this in the online docs for the HTML taglib. Thanks, Jason Larry Maturo wrote: Since I see these questions come up, and I just got them figured out, I thought I would share them with the mailing list. Select can be used with: a: A collection of strings, such as an arraylist b: A collection of beans, each of which has string fields c: Hard coded values I know you can combine a and c, as well as b and c. I'm guessing you could combine a, b, and c as well. With An ArrayList of Strings ArrayList name is nameList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. html:select property=selectedValue html:options name=nameList / /html:select With An ArrayList of Beans -- Bean string fields of interest are: 1. displayValue 2. idValue ArrayList name is beanList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. It should be set to the idValue of the selected bean. html:select property=selectedValue html:options collection=nameList property=idValue labelProperty=displayValue/ /html:select With HardCoded Values - name of field in form bean to set is selectedValue. html:select property=selectedValue html:option value=value_1/ html:option value=value_2/ html:option value=value_3/ /html:select -- Larry Maturo [EMAIL PROTECTED] Athens Group, Inc. -- Jason Wells Web Architect Xsilogy, Inc. http://www.xsilogy.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
select/options/option
Since I see these questions come up, and I just got them figured out, I thought I would share them with the mailing list. Select can be used with: a: A collection of strings, such as an arraylist b: A collection of beans, each of which has string fields c: Hard coded values I know you can combine a and c, as well as b and c. I'm guessing you could combine a, b, and c as well. With An ArrayList of Strings ArrayList name is nameList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. html:select property=selectedValue html:options name=nameList / /html:select With An ArrayList of Beans -- Bean string fields of interest are: 1. displayValue 2. idValue ArrayList name is beanList. This list has been put into either the request or session. name of field in form bean to set is selectedValue. It should be set to the idValue of the selected bean. html:select property=selectedValue html:options collection=nameList property=idValue labelProperty=displayValue/ /html:select With HardCoded Values - name of field in form bean to set is selectedValue. html:select property=selectedValue html:option value=value_1/ html:option value=value_2/ html:option value=value_3/ /html:select -- Larry Maturo [EMAIL PROTECTED] Athens Group, Inc. winmail.dat Description: application/ms-tnef -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]