Hi Paul, Your question seems very similar to my post last week. "I need to set a "pre-defined" option in <html:select> using the >>"value=" attribute, I thought the following will work: " For this you can set the attribute in your form class and when you use <html:select>in your jsp, while populating the options in the drop down, struts will automatically select the dafult predetermined option and show it as selected. (See vincent and robert's posts). Let me know if that helps!
(I did try the same logic and when i give system.out in my jsp, it is identifying the correct default value-only that I cant see the option selected.let me know if yours works from these hints. That would help me too) :-))) Thanks, Sam. "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: I see. I'll try that tomorrow and let you know. Thx. -----Original Message----- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 12:05 AM To: Struts Users Mailing List Subject: Re: question the most simplest solution is often the best Au-Yeung, Stella H wrote: > Paul wrote: > >>> >>> > > labelProperty="name"/> > > No I don't know how to try yours because I don't see how the above > statement tells it to compare "userId" with "person.id" and then store > the value into "person.id". > > In other words, I don't know how to convert my statement below to > yours: > >> >> >>collection="uList" name="UserFormBean" property="userId" >>labelproperty="commonName"/> > > > -----Original Message----- > From: Paul Stanton [mailto:[EMAIL PROTECTED] > Sent: Monday, March 08, 2004 6:45 PM > To: Struts Users Mailing List > Subject: Re: question > > > i think you are trying to do the following... > > > labelProperty="name"/> > > > this is assuming uList is a list of beans with id/name fields and your > form has a userId field. > > Au-Yeung, Stella H wrote: > > >>Hi: >>I need to set a "pre-defined" option in using the >>"value=" attribute, I thought the following will work: >> >> >> >>collection="uList" name="UserFormBean" property="userId" >>labelproperty="commonName"/> >> >>I have a "person" bean. I want to set the "selected" option if >>"person.id" matches "userId" . I thought the "value" attribute is to > > be > >>compared with for marking an option selected. But the above doesn't > > work. > >>It always set the 1st option to be the "selected" option . >>Am I misunderstanding the use of "value="? >> >> >> >>--------------------------------------------------------------------- >>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] > > --------------------------------------------------------------------- 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] --------------------------------- Do you Yahoo!? Yahoo! Search - Find what you�re looking for faster.

