I think it will work as it is... tomK
> -----Original Message----- > From: Maris Orbidans [mailto:[EMAIL PROTECTED]] > Sent: dinsdag 20 november 2001 16:49 > To: Struts Users Mailing List > Subject: RE: which button pressed? > > > > Do I have to change my JSP code ? > > Will it work as it is now ? > > > > > <table border="0"> > <tr> > <td><html:submit property="prev"><bean:message > key="button.prev"/></html:submit></td> > <td><html:submit property="next"><bean:message > key="button.next"/></html:submit></td> > <td><html:submit property="save"><bean:message > key="button.save"/></html:submit></td> > <td><html:submit property="delete"><bean:message > key="button.delete"/></html:submit></td> > <td><html:submit property="add"><bean:message > key="button.add"/></html:submit></td> > </tr> > </table> > > -----Original Message----- > From: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 20, 2001 5:40 PM > To: Struts Users Mailing List > Subject: RE: which button pressed? > > > I've seen 2 ways to do this: > > (1) in the action, go over all possible values to check if it is not > null: > boolean prevPressed = request.getParameter("prev")!=null; > boolean nextPressed = request.getParameter("next")!=null; > ... > > (2) use a more bean-minded approach: add some setters to your > form bean, > like > private String pressedButton; > public void setPrev(String prev){ > pressedButton = "prev"; > } > public void setNext(String next) { > pressedButton = "next"; > } > ... > This forces struts in setting the "pressed button" for you. The action > can then just check form.getPressedButton() or something similar. > > hth, > tomK > > > -----Original Message----- > > From: Māris Orbidāns [mailto:[EMAIL PROTECTED]] > > Sent: dinsdag 20 november 2001 16:06 > > To: Struts-list (E-mail) > > Subject: which button pressed? > > > > > > > > Hello all > > > > I have several submit buttons like this: > > > > > > <table border="0"> > > <tr> > > <td><html:submit property="prev"><bean:message > > key="button.prev"/></html:submit></td> > > <td><html:submit property="next"><bean:message > > key="button.next"/></html:submit></td> > > <td><html:submit property="save"><bean:message > > key="button.save"/></html:submit></td> > > <td><html:submit property="delete"><bean:message > > key="button.delete"/></html:submit></td> > > <td><html:submit property="add"><bean:message > > key="button.add"/></html:submit></td> > > </tr> > > </table> > > > > The question is: How to determine which one has been pressed ? > > > > > > Maris Orbidans > > > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:struts-user-> [EMAIL PROTECTED]> > > For > > additional commands, > > e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > -- > To unsubscribe, e-mail: > <mailto:struts-user-> [EMAIL PROTECTED]> > For > additional commands, > e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>