struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Childers" <jchild...@hotels.com>
Subject RE: Struggling with html:options
Date Wed, 09 Jul 2003 17:12:02 GMT
Try this.

In your Action:

ArrayList months = new ArrayList();
months.add(new LabelValueBean("January", 1);
months.add(new LabelValueBean("Februrary", 2);
request.setAttribute("months", months);

In your JSP:

<html:select property="yourFormProperty">
    <html:options collection="months" property="value" labelProperty="label" />
</html:select>

HTH,

-= J

> "sjones" <sjones19662000@yahoo.com> wrote in message
> news:behd26$5l0$1@main.gmane.org...
> > Good Morning Everyone.
> >
> > I have a List object and i need my JSP page
> > to build a drop down list box using the List as the source
> > for the options.
> >
> > I can do it with a scriplet but i need to one of the struts tags
> > <html:options>
> > <html:optionsCollection>
> >
> > can anyone help me with use one of these tags.
> >
> > I am looking at the java.docs but it doesn't really help me.
> >
> > the List is also accessible from a classs name EqualityOperators
> >
> > List o = EqualityOperators.getOperators();

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message