struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "gnanaseelan" <gnanaseel...@indscape.com>
Subject Re: Multibox intial selection problem
Date Thu, 28 Feb 2002 06:33:19 GMT
Hi Nico

Thanks ,i got it its working fine
Thanks a lot

Bye
gnan
----- Original Message -----
From: "Nicolas De Loof" <nicolas.deloof@cgey.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>;
<Rajesh.TPradhan@patni.com>
Sent: Monday, June 24, 2002 7:24 PM
Subject: Re: Multibox intial selection problem


> A cleaner (IMHO) way for generating such select in HTML would be :
>
> <html:select property="monthstosave">
>     <html:options collection="monthstosaveValues"
>                   property="value"
>                   labelProperty="label"/>
> </html:select>
>
> ... where "monthstosaveValues" is a collection of objects that have
"value"
> and "label" property (attribute+getters) for your select box items (that
> could be placed in application scope if it is constant between users).
>
> If "monthstosave" property of your formBean has a value, it will be
> automatically preselected in generated HTML.
>
> You can find more about html:options use in
> http://jakarta.apache.org/struts/doc-1.0.2/struts-html.html#options
>
> Nico
>
> > > Hi
> > > Do something like this:
> > >
> > >
> > >
> > >
> > >  <td width="25%" Class=DisplayLeftDataCells>
> > > <select size="1" name="downloadday" id="downloadday">
> > >   <%
> > >     for(int i=0;i<monthstosave.length;i++){
> > >   %>
> > > <OPTION
> > > <%
> > >     if (downloadday.equals(monthstosave[i])){
> > >     %>selected<%}%>
> > > value='<%=monthstosave[i]%>'><%=monthstosave[i]%></OPTION>
> > > <%}
> > >   %>
> > >                               </select></td>
> > >
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>


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


Mime
View raw message