Subject: Re: [Q] select : Option - Urgent Help required. From: Vic Cekvenich <[EMAIL PROTECTED]> ===
http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg26863.html Yes, vi! Vic Galbreath, Mark wrote: > No one on my team has been able to get the Collections iterator to work for > <html:options> so we are doing as I posted. If you have some insight into > getting it to work, I'm all eyes! > > Also, the iterate name should not be enclosed in JSP session variable > delimiters unless a method is being called to get the value. > > Mark > > -----Original Message----- > From: Stuart Jameson [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 9:34 AM > > You could use the <html:options> tag > > -----Original Message----- > From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] > Sent: 17 April 2002 13:45 > > I'm not totally clear on your Region or bean attributes, but the idea is > something like: > > // bean property to set/get > <html:select property="selectedRegion"> > // List to iterate, type is fully-qualified path, > // id is arbitrary, property is List element > <logic:iterate name="<%= regions %>" > property="id" > type="Region" > id="region"> > // set the option value > <html:option value="<%= region.getId() %>"> > // set the option label > <bean:write name="region" property="String" /> > </html:option> > </logic:iterate> > </html:select> > > Mark > > -----Original Message----- > From: Sanjay Choudhary [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 8:23 AM > > >>Need help with select option >> >>I have a formBean called RegionForm >> >>RegionForm contain attribute selectedregion:String >>and >>regions:ArrayList. >> >>regions:ArrayList is collection of object of class >>Region. >> >>Region class has attributes id and String. >> >>I wish to display on the form select option in the >>drop down box and populate it with all the items in >>the regions:Arraylist and display id attribute. >>Selected value should populate selectedregion:String >>in RegionForm. >> >>I tried nested:select and html:select but no >>success. >> > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>