You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gr...@cs.com on 2002/07/02 19:39:16 UTC
struts:select & struts:options
Does anybody have any examples of how you create a struts:select / struts:options using just a static list of options and not a collection?
Thanks
G. Taylor
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: struts:select & struts:options
Posted by James Mitchell <jm...@telocity.com>.
Or do mean like this?
<html:select property="prefixNumber">
<option value="1">Number 1</option>
<option value="2">Number 2</option>
<option value="3">Number 3</option>
<option value="4">Number 4</option>
</html:select>
James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta
> -----Original Message-----
> From: James Mitchell [mailto:jmitchtx@telocity.com]
> Sent: Wednesday, July 03, 2002 12:55 AM
> To: Struts Users Mailing List
> Subject: RE: struts:select & struts:options
>
>
> Do you mean like this?
>
> <%-- In real life, these would be loaded from a database --%>
> <%
> java.util.ArrayList list = new java.util.ArrayList();
> list.add(new org.apache.struts.util.LabelValueBean("IMAP Protocol",
> "imap"));
> list.add(new org.apache.struts.util.LabelValueBean("POP3 Protocol",
> "pop3"));
> pageContext.setAttribute("serverTypes", list);
> %>
>
> ...
> ...
>
> <td align="left">
> <html:select property="type">
> <html:options collection="serverTypes" property="value"
> labelProperty="label"/>
> </html:select>
> </td>
>
>
>
>
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network"
> http://www.open-tools.org/struts-atlanta
>
>
>
>
> > -----Original Message-----
> > From: greg1java@cs.com [mailto:greg1java@cs.com]
> > Sent: Tuesday, July 02, 2002 1:39 PM
> > To: struts-user@jakarta.apache.org
> > Subject: struts:select & struts:options
> >
> >
> > Does anybody have any examples of how you create a struts:select
> > / struts:options using just a static list of options and not a
> collection?
> >
> >
> > Thanks
> > G. Taylor
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: struts:select & struts:options
Posted by James Mitchell <jm...@telocity.com>.
Do you mean like this?
<%-- In real life, these would be loaded from a database --%>
<%
java.util.ArrayList list = new java.util.ArrayList();
list.add(new org.apache.struts.util.LabelValueBean("IMAP Protocol",
"imap"));
list.add(new org.apache.struts.util.LabelValueBean("POP3 Protocol",
"pop3"));
pageContext.setAttribute("serverTypes", list);
%>
...
...
<td align="left">
<html:select property="type">
<html:options collection="serverTypes" property="value"
labelProperty="label"/>
</html:select>
</td>
James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta
> -----Original Message-----
> From: greg1java@cs.com [mailto:greg1java@cs.com]
> Sent: Tuesday, July 02, 2002 1:39 PM
> To: struts-user@jakarta.apache.org
> Subject: struts:select & struts:options
>
>
> Does anybody have any examples of how you create a struts:select
> / struts:options using just a static list of options and not a collection?
>
>
> Thanks
> G. Taylor
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>