Thibaut wrote the following on 1/19/2006 1:09 PM:
Hi,
I'd like to choose the default value of my html:select in the action
class. What is the parameter to set ?
Set the value of the form bean property in your Action before you go to
the form and that will be the default. Or, you could even set the value
in the formBean itself if you know it's always going to be the same
default value.
ie in Action:
MyForm myForm = (MyForm)form;
myForm.setPartner_id( defaultId );
in ActionForm:
int partner_id = 20; //or whatever you want it to be
Action :
request.setAttribute("partnerslist",
getPartnerListFromDataBase(dataSource));
JSP:
<html:select property="partner_id">
<html:options collection="partnerslist" property="value"
labelProperty="label"/>
</html:select>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]