I'm still in the process of learning S2 and I was curious on what's the best
practice in implementing a form with multiple submit buttons

I've read that there are multiple way to implement this. 
One way is here:
http://struts.apache.org/2.0.8/docs/multiple-submit-buttons.html
Although I was thinking I had to redo my setup of my action class and have
all the actions point to one method - execute() and from there i would check
a parameter to determine what my next step would be:

public String execute() {
      if (method.equals(searchMethod)) {
         doSearch();
         return SUCCESS;
      }
      if (method.equals(addMethod)) {
         doAdd();
         return SUCCESS;
      }
   }

something to that effect.

But I also wanted to try having an action class with different methods and
in my struts.xml the different actions would point to the different methods
of my action class.

My problem though is I have a form with multiple submit buttons. I tried
specifying the action on each submit button but the action in my form
overrides the action specified in the buttons. I tried removing the action
parameter in my form but it would take the current action and still override
the actions specified in the buttons. How do I have a form with multiple
submit buttons with different actions? What would be the best practice in
implementing this? Would implementation be any different if my submit
buttons are ajax themed?

Thanks
-- 
View this message in context: 
http://www.nabble.com/-S2--Multiple-Submits-with-different-actions-in-a-Form-tf4140299.html#a11776889
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to