Try using:
<html:option value="${exampleFormBean.apps.actions[3]}"><bean:write
name="act"/></html:option>

If act is the third element in the list apps.


On 3/23/06, Shoukat, Faisal <[EMAIL PROTECTED]> wrote:
>
> When I do the below in the form it submits
> {exampleFormBean.apps.actions.act}
>
> As the value.  I have a getter defined for apps in the formbean and in
> apps
> there is a getter for actions.
>
> There is no getter for act as this is deifined in the iterate tag
>
> Still stuck!!
>
> -----Original Message-----
> From: Vinit Sharma [mailto:[EMAIL PROTECTED]
> Sent: 23 March 2006 15:01
> To: Struts Users Mailing List
> Subject: Re: html:option on a nested collection
>
> You can use EL extention of html tag and use something like this:
>
> <html:option value="${exampleFormBean.apps.actions.act}"><bean:write
> name="act"/></html:option>
>
> Assuming getters are defined for all properties.
>
> Regds,
>
>
> On 3/23/06, Shoukat, Faisal <[EMAIL PROTECTED]> wrote:
> >
> > Hi Guys,
> >
> >
> >
> > I have a formBean which has a collection of objects within it called
> Apps.
> > Each App object has several fields with one of these fields being a
> > collection or list of Strings.
> >
> >
> >
> > ExampleFormBean properties are
> >
> >
> >
> > String Name
> >
> > String Class
> >
> > String Student
> >
> > List apps
> >
> >
> >
> > Each app object looks like this
> >
> > String first
> >
> > String second
> >
> > List actions.  --- This is a collection of Strings
> >
> >
> >
> > I am trying to display the actions of the app object in a drop down
> list.
> > But am having a few problems with the option tag.
> >
> >
> >
> > So far I have this:
> >
> > <logic:iterate name="exampleformbean" property="apps" id="app">
> >
> >
> >
> > <html:select property="action" >
> >
> >                <logic:iterate id="act" name="app" property="actions"
> > indexId="index">
> >
> >                      <html:option value="1"><bean:write
> > name="act"/></html:option>
> >
> >
> >
> >                 </logic:iterate>
> >
> >          </html:select>
> >
> >
> >
> > This code displays the drop down with the correct string values showing.
> > However where I have put one above as the option value I actually want
> to
> > put something like the actual String i.e: <bean:write name="act"/>.
> >
> >
> >
> > Does anyone know how I can do this. I have tried html:options and
> > optionscollections but could not get them to work.
> >
> >
> >
> > If the suggestion is to go with nested tags please provide an example as
> I
> > could not get far with this either.
> >
> >
> >
> > Secondly, If I submit the form but have modified two rows from the drop
> > down
> > when I get to the action class how can I know which rows I have
> modified.
> >
> >
> >
> > Thanks in advance
> >
> >
> >
> >
> >
>
>
> --
> Vinit Sharma
>
>
> ----------------------------------------------------------------------------
> --------
> The Northgate IS Content Screening and Inspection system has scanned this
> message for malicious and inappropriate content and none was found. Please
> take care
> when opening attachments even when these are expected and from known and
> trusted
> sources.
>
> ----------------------------------------------------------------------------
> --------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Vinit Sharma

Reply via email to