<html:option value="">State:</html:option>
<html:options name="USStateValues" labelName="USStateLabels"/>
</html:select>
Where USStateValues and USStateLabels are application scope attributes. USStateValues is {"AL", "AZ", "AR", . . .} and USStateLabels is {"Alabama", "Arizona", . . .} etc. The user sees the label, and the value is what's posted.
Erik
Stéphane Zuckerman wrote:
Hello,
I am quite new to Struts, but have been playing with this framework for some time now (mostly as a means of understanding the framework)... There is still one thing that isn't clear for me though : I understand how to use a "simple" html:select tag, but when it comes to use a Collection object (such as an ArrayList or a Vector, as these are the objects that are mostly used in tutorials), I am finding myself a little bit confused. I am not sure as to exactly what the attributes of the <html:select/> and <html:options/> refer to. I've already searched through the examples of the distribution, as well as other sites (like jguru), but I really have a problem dealing with select...
My use would be something very basic, such as retrieving a list/array of string values (from a database, for instance), and display them as options for my select. I'd first thought of using something like the <logic:iterate/> tag, but I suppose it wouldn't be very coherent with the existence of <html:options/> ...
Could someone post a very simple case of how to use the html:options tag ?
Thank you very much.
Stephane
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]