Hi

I handle something like this, how you describe it at last. I route both buttons to a 
single action class, and this class decides, based on the pressed button (value), what 
to do. As much as I know it is not possible to submit buttons to different action, 
because you decide in the <html:form> tag, which action will be invoked.

Marcel

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 15, 2001 5:51 AM
To: [EMAIL PROTECTED]
Subject: Multiple Submit Buttons per Form



I'm pretty new to struts so please forgive me if this question been asked
before (I searched the archives and didn't find anything like it).  I have
an OPENSTEP / WebObjects background.

Is it possible to have 2 submit buttons (or image buttons) within the same
form that route to different action classes?

For example if I have a page that has a popup and 2 buttons (maybe a create
button and a modify button).  I'd like the create button to invoke
perform(blah) on a CreateAction class and the modify button to invoke
perform(blah) on a ModifyAction class.

1 way to do it could be to put both buttons in different forms.  However
that won't work because I want to check the selection in the popup in both
my create and modify classes.

Another way to do it could be route both buttons to a single action class,
which would conditionalize based on which button was clicked.  I find this
approach particularly inelegant tho.

Anybody done anything like this?  If so how did u set this up?

thanks.

-shehryar

Reply via email to