> From: Wendy Smoak <[EMAIL PROTECTED]> > Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Date: Mon, 18 Aug 2003 14:06:06 -0700 > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> > Subject: RE: html:select Not 'Selecting' My Item > > Hunter wrote: >> The HTML generated for the <select> looks as follows: >> <select name="associatedSalesperson"> >> None of the options are selected. In this example the >> getEncodeAssociatedSalespersonID() returns Bob-7. >> I also tried it retunring 'Bob, Darin'. Still, the item is not selected. > > Those names don't match! Change the name of the 'get' method to > 'getAssociatedSalesperson' and see if things improve.
I thought I could use value to override what property was being used to determine which item was selected. I cannot use associatedSalesperson as my matching item. It won't match. We do some processing on the input before we put it in our database... That's what I want to use the other method to output a string that will match. > > In an earlier message, you wrote: >> <html:select property="associatedSalesperson" >> name="sampleRequestCompleteForm" >> value="encodeAssociatedSalespersonID"> > > The 'property' in the <html:select> tag needs to match the get/set methods. > You DO NOT need to use the 'value' attribute, Struts will automatically > pre-select the right value based on what's in the Form bean. > > (I'm almost certain I answered this last week... Hopefully I haven't > contradicted myself!) I thought I could use value to override. I don't want the default behavior here. Please see above. Thanks, Hunter --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]