Hi Jim Can u post that code will be a grest help, also will it work for many pages or have to have one action for each page Ashish Renato Aganippe wrote:Jim,
I'll be interested in your action code. Thank you, Renato ----- Original Message ----- From: To: "Struts Users Mailing List" Sent: Thursday, August 29, 2002 7:08 PM Subject: Re: Struts and Many Buttons on Single page > > Have been through this one; originally used option 2 (javascript to on > button click to change action), but as we use httpunit to acceptance test, > which does not support javascript, we migrated to a third option: > > Have a generic action to route based on button pressed. > > In the html: > > > > ... > > In struts config.xml: > > type = "com.whatever.GenericSubmitRouteAction" > ... > > > > > The code for the generic submit route action looks for which button was > pressed, and maps to the appropriately named forwarding. If anyone is > interested in this approach I'll post the code for the routing action. > > It would be nice if Struts somehow supported this sort of thing (forms with > multiple actions based on submit button pressed) inherently. > > > Jim Weaver > Software Developer - ThoughtWorks > [EMAIL PROTECTED] > > > > > "Renato Aganippe" > > eb.com> cc: > Subject: Re: Struts and Many Buttons on Single page > 08/29/2002 11:22 > AM > Please respond to > "Struts Users > Mailing List" > > > > > > > Hi, > > I see two solution for this. > > 1) For each button, you can define a different form with a different action > attribute > > > 2) You can use a javascript function to change the action attribute > > Ex: > > function doSubmit(val) { > if (val==1) { > document.forms.consult.action='/save.do'; > } > else if (val==2) { > document.forms.consult.action='/remove.do'; > } > document.forms.consult.submit(); > } > > > > > [input] > onClick="doSubmit(1);return false;"> > [input] > (confirm('Etes vous certain de vouloir supprimer cet enregistrement ?')) > doSubmit(2); return false;" type=button value=Delete> > > > > Hope it will help, > > Renato > > ----- Original Message ----- > From: "Ashish Kulkarni" > To: "Struts Users Mailing List" > Sent: Thursday, August 29, 2002 4:31 PM > Subject: Struts and Many Buttons on Single page > > > > > > Hi, > > > > I am developing a struts applicatian, I have a jsp page where i have 5 > buttons, say Add, Change,Delete, Display. > > > > When i click these buttons they must call different jsp with different > parameters, how can i do it??? > > > > Ashish > > > > > > A$HI$H > > > > > > --------------------------------- > > Do You Yahoo!? > > Yahoo! Finance - Get real-time stock quotes > > > > -- > To unsubscribe, e-mail: < > mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: < > mailto:[EMAIL PROTECTED]> > > > > > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > > -- To unsubscribe, e-mail: For additional commands, e-mail: A$HI$H --------------------------------- Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes