Sorry my mistake. You set the collection value of the options equal to the request attribute referencing the ArrayList object. Ie ROOMTYPES as below.
<html:select property="roomType" name="editHotel"> <html:options collection="ROOMTYPES" property="value" labelProperty="label"/> </html:select> -----Original Message----- From: rahul [mailto:[EMAIL PROTECTED] Sent: 20 September 2005 14:22 To: Struts Users Mailing List Subject: RE: <html:select> tag I did that, created ArrayList containing LabelValueBean and this ArrayList is still in a bean as a request attribute. now what to do with <html:options> ? --RahulJoshi > -----Original Message----- > From: Harland, David [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 20, 2005 6:13 PM > To: Struts Users Mailing List > Subject: RE: <html:select> tag > > > Hi, > > Create an ArrayList object. Iterate through your Hashtable(HashMap is a > better option). > For each iteration create a new org.apache.struts.util.LabelValueBean > object. Populate its label and value attributes and then add it to your > ArrayList object. Then pass the ArrayList object as the property. > > Regards > > Dave. > > -----Original Message----- > From: rahul [mailto:[EMAIL PROTECTED] > Sent: 20 September 2005 13:11 > To: Struts Users Mailing List > Subject: <html:select> tag > > hi David, > > I have got one more problem, this time its related to select box > which is rendered using <html:select> tag enclosing one or more > <html:option> or <btml:options> > > I have got an ActionForm set as request attribute, which contains > a property of type java.util.Hashtable > > I wanted to display the values (only values without keys) in a select > box > > so i tried > <html:options property="HashtableProperty" name="MyActionForm" > /> > but this displays "key=value" in my select box, not just "value" > > If I change my property type to java.util.ArrayList then it works fine > > But the reason I want it with hashtable is that I want Hashtable's key > as > value of select box and the corresponding value as displayed item. > > > any Suggestions? > > --RahulJoshi > > > > > -----Original Message----- > > From: rahul [mailto:[EMAIL PROTECTED] > > Sent: Monday, September 19, 2005 8:43 PM > > To: Struts Users Mailing List > > Subject: RE: Radio Button in ActionForm > > > > > > thank you very much > > It worked! > > > > > -----Original Message----- > > > From: Harland, David [mailto:[EMAIL PROTECTED] > > > Sent: Monday, September 19, 2005 6:07 PM > > > To: Struts Users Mailing List > > > Subject: RE: Radio Button in ActionForm > > > > > > > > > Initialise your Action Form set sec equal to 'M' or 'F'. > > > > > > Add the following to your jsp > > > <html:radio property="sex" name="MyActionForm" value="M"/> > > > <html:radio property="sex" name="MyActionForm" value="F"/> > > > > > > > > > -----Original Message----- > > > From: rahul [mailto:[EMAIL PROTECTED] > > > Sent: 19 September 2005 13:34 > > > To: Struts Users Mailing List > > > Subject: Radio Button in ActionForm > > > > > > hi all, > > > > > > I am looking at some simplified way of displaying the radio button > > > on a jsp depending upon the value of an ActionForm's property. > > > > > > For example I have got an ActionForm with a property name sex, which > can > > > take 'M' or 'F' as input. > > > > > > Now after storing the value in an ActionForm instance (which is then > set > > > as > > > a request > > > attribute) from database, I am forwarding the request to a jsp where > I > > > need > > > to > > > display the values I collected. like > > > > > > (.) Male > > > ( ) Female > > > > > > Is there any elegant way of doing this using <html:radio> tags in > struts > > > ? > > > > > > > > > I know its pretty simple in case of simple input box where we do it > by > > > <html: text property="sex" name="MyActionForm" /> but how to go with > > > radio > > > buttons ? > > > > > > > > > Any suggestions ? > > > > > > --Rahul > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > This e mail is from DLA Piper Rudnick Gray Cary UK LLP. > > > > > > The contents of this email and any attachments are confidential > > > to the intended recipient. They may not be disclosed to or used > > > by or copied in any way by anyone other than the intended > > > recipient. If this email is received in error, please contact DLA > > > Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 111111 quoting the > > > name of the sender and the email address to which it has been > > > sent and then delete it. > > > > > > Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor > > > the sender accept any responsibility for viruses and it is your > > > responsibility to scan or otherwise check this email and any > > attachments. > > > > > > DLA Piper Rudnick Gray Cary UK LLP is a limited liability > > > partnership registered in England and Wales (registered number > > > OC307847) which provides services from offices in England, > > > Belgium, Germany and the People's Republic of China. A list of > > > members is open for inspection at its registered office and > > > principal place of business 3 Noble Street, London EC2V 7EE. > > > Partner denotes member of a limited liability partnership. > > > > > > DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law > > > Society and is a member of DLA Piper Rudnick Gray Cary, a global > > > legal services organisation, the members of which are separate > > > and distinct legal entities. For further information, please > > > refer to www.dlapiper.com. > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > This e mail is from DLA Piper Rudnick Gray Cary UK LLP. > > The contents of this email and any attachments are confidential > to the intended recipient. They may not be disclosed to or used > by or copied in any way by anyone other than the intended > recipient. If this email is received in error, please contact DLA > Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 111111 quoting the > name of the sender and the email address to which it has been > sent and then delete it. > > Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor > the sender accept any responsibility for viruses and it is your > responsibility to scan or otherwise check this email and any attachments. > > DLA Piper Rudnick Gray Cary UK LLP is a limited liability > partnership registered in England and Wales (registered number > OC307847) which provides services from offices in England, > Belgium, Germany and the People's Republic of China. A list of > members is open for inspection at its registered office and > principal place of business 3 Noble Street, London EC2V 7EE. > Partner denotes member of a limited liability partnership. > > DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law > Society and is a member of DLA Piper Rudnick Gray Cary, a global > legal services organisation, the members of which are separate > and distinct legal entities. For further information, please > refer to www.dlapiper.com. > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 111111 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]