wendy, my dropdown is populating properly but i couln't populate "name" in my itembean.
> <option value='<bean:write name="ItemType" property="code"/>'> > <bean:write name="ItemType" property="name" /> here the value "code" is populated to the field "code" in my item bean. how can i populated "name". how can i link the both as the "name" should be populated based on the selected "code". can you please guide me with some sample code? regards and many thanks. -----Original Message----- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: 24 November 2005 15:49 To: Struts Users Mailing List Subject: Re: populating form difficulty?? On 11/24/05, Kanuri, Chand <[EMAIL PROTECTED]> wrote: > hi all, > i have a dropdown list in my struts web app, > i am having a form in which a bean is instatiated(bean has 2 properties > "name" and "code"). > > i am using like this in the jsp: > > <html:select property="item.code"> > <logic:iterate id="itemType" > name="<%=WebConstants.getItemTypeListName()%>"> > <option value='<bean:write name="ItemType" property="code"/>'> > <bean:write name="ItemType" property="name" /> > </option> > </logic:iterate> > </html:select> Have you considered using <html:options> or <html:optionsCollection> here? You shouldn't have to do the iteration or write out the <option> tags yourself. > now i want to populate property "name" in the item bean(which should not be > shown on the screen.it should be a hidden field) > > when the user clicks on the item name on the dropdown item beans "code" is > populating.now i need to populate "name" aswell at the sametime using hidden > property. Do you really? You're the one who provided the codes and names for the drop-down, so you must know what they are... when the form is submitted, simply use the 'code' to look up the 'name' from the same place. I typically keep Maps in Application or Session scope, and use them to populate select lists across the app (or for a particular user.) -- Wendy --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail (and any attachments) may contain privileged and/or confidential information. If you are not the intended recipient please do not disclose, copy, distribute, disseminate or take any action in reliance on it. If you have received this message in error please reply and tell us and then delete it. Should you wish to communicate with us by e-mail we cannot guarantee the security of any data outside our own computer systems. For the protection of Legal & General's systems and staff, incoming emails will be automatically scanned. Any information contained in this message may be subject to applicable terms and conditions and must not be construed as giving investment advice within or outside the United Kingdom. The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited (life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments). They are registered in England under numbers shown. The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP. Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930 They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]