I have often added form properties to represent flags for the different
button actions to process. My ActionForm would have two properties
"update" and "new":
setUpdate(boolean flag){}
boolean isUpdate()
For the submit buttons:
<html:submit property="update" value="true" />
If I have to use an image for the submit button I generally will have a
hidden flag form field that I populate in the JavaScript onclick event
handler.
HTH,
Greg
> -----Original Message-----
> From: Philip Mark Donaghy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 06, 2003 6:23 AM
> To: Struts Users Mailing List
> Subject: RE: html:submit and 2 buttons
>
> Your action can read the value attribute of your
> submit tag. This is the label in your case.
>
> <bean-el:message key="search.new"/>
>
> Use the request.getParameter to find out which button
> was clicked. Give each of your submit buttons a
> different NAME. request.getParameter(NAME) will return
> the label of the submit button clicked or null.
>
> Phil
>
> --- "Arik Levin ( Tikal )"
> <[EMAIL PROTECTED]> wrote:
> >
> > You can just use JavaScript passing some parameters
> >
> > You can also try this approach:
> > http://husted.com/struts/tips/003.html
> >
> >
> > -----Original Message-----
> > From: Frers Michael [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, November 05, 2003 6:54 PM
> > To: Struts Users Mailing List
> > Subject: html:submit and 2 buttons
> >
> > Hello
> >
> > just a little question about the taglib
> >
> > i want to have one form with 2 buttons in it
> >
> >
> > one button should do "new"
> > the other "update"
> >
> > how can i make my action class know which button was
> > hit?
> >
> > additionally i want that the buttons get there
> > labels from a property file
> > that works as shown below but how can i now make my
> > action class know which
> > button is hit?
> > <html-el:submit ><bean-el:message
> > key="search.new"/></html-el:submit>
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> =====
> Java Web Application Architect
> mapimage.com - Java and GIS
> struts1.1:tomcat4.1.27:linuxRH8
>
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]