Re: html:select default value in the action

2006-01-20 Thread Laurie Harper
In your preceeding example code, it didn't work because you were calling it a a locally created form, not the one that the JSP saw. If you call it on the form Struts passes into your action, it should work fine. L. Thibaut wrote: ok I understand but why "form.set("partner_id",secteurDefault);

Re: html:select default value in the action

2006-01-20 Thread Thibaut
ok I understand but why "form.set("partner_id",secteurDefault);" doesn't work ? " public ActionForward execute(..., ActionForm form,...) { ... form.set("partner_id",secteurDefault); ... } " Where form is a DynaForm Thank you Laurie Harper a écrit : Thibaut wrote: Thank you for your quick r

Re: html:select default value in the action

2006-01-19 Thread Laurie Harper
Thibaut wrote: Thank you for your quick reply. I use dyna form. Therefore i have to create a new instance of the dynaform. You should never have to do this manually. Struts will create the form for you provided your action mapping specifies the form name via the 'name' attribute. //get th

Re: html:select default value in the action

2006-01-19 Thread Thibaut
Thank you for your quick reply. I use dyna form. Therefore i have to create a new instance of the dynaform. //get the parameter I want to put by default String secteurDefault = request.getParameter("secteur"); if(secteurDefault!=null) { if(form == null) { FormBeanConfig cfg = mapping.get

Re: html:select default value in the action

2006-01-19 Thread Rick Reumann
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 s

html:select default value in the action

2006-01-19 Thread Thibaut
Hi, I'd like to choose the default value of my html:select in the action class. What is the parameter to set ? Action : request.setAttribute("partnerslist", getPartnerListFromDataBase(dataSource)); JSP: labelProperty="label"/> Thanks. -