On 8/21/06, sheetal <[EMAIL PROTECTED]> wrote:
Hi, My action class on success, is prepopulating a combo box (<select>.. <option>...>, on the jsp.. for which I have used a form bean. Now, the problem is that I also want a field to be selected from combo, after prepopulating it.. and before displaying the jsp page... If anyone has any idea,.. Thanks.. Rgds, Sheetal
You could specify the value attribute in the select tag. This will be matched with the value of the options element. If a match occurs that value will be selected. In case a match does not occur, first options element will be selected. Please not the value and the label are two different things. for e.g. <select value="1">label</select> Here is an example using <html:options> <html:select property="foo" value="valueToSelect"> <html:options collection="someCollection" property="foo" labelProperty="title" /> </html:select> So in the above example someCollection.get(index).getFoo() will be comapred with valueToSelect and someCollection.get(index).getTitle() will be used for making the label. Hope this helps. Puneet