Thanks Michael : I can do what you suggested of creating read-only attribute in User class. But all over I am using BeanUtils to copy back and forth Users properties to UserForm properties. Is there a cleaner way so even after my adding/deleting properties in my User class, I don't need to make corresponding change in UserForm class ?
Thanks again for looking into this. Digant "Michael Jouravlev" <[EMAIL PROTECTED]> 03/01/2006 04:44 PM Please respond to "Struts Users Mailing List" To: "Struts Users Mailing List" <user@struts.apache.org> cc: Subject: Re: How to display combination of two columns in label of html:option On 3/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > In my jsp I am using users ArrayList which is collection of User bean on > server side. > My drop down list works fine as under when I use only one display > userNameShort in my example. > > <html:select property="userIdNew"> > <option value="-1">Choose User...</option> > <html:options collection="users" > property="userId" > labelProperty="userNameShort" /> > </html:select> > > Now I want to combine two attributes concatenation in label for e.g. > userId+"("+userNameShort"+")" > > how would I do that ? Create a read-only property in the User bean that returns userId+"("+userNameShort"+")". For example: public class User ... { ... public String getUserIdAndName() { return userId+"("+userNameShort"+")"; } } <html:select property="userIdNew"> <option value="-1">Choose User...</option> <html:options collection="users" property="userId" labelProperty="userIdAndName" /> </html:select> Michael. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and affiliates.