Re: Same action with multiple submit buttons
how funny is that.. why do you want to give the same name to all of your buttons?? Pazhanikanthan Periasamy <[EMAIL PROTECTED]> wrote: Have a hidden attribute called method. Assign this param with the method name u need to call in the DispatchAction Class based on the Button you have clicked and submit the form. Thanks and regards, Pazhanikanthan. P Project Leader, Caritor (India) Pvt. Ltd., Madras - 600 006 Mob: 9886152717 Extn: 40123 "Shiby Maria John" 12/21/2005 03:02 PM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject Same action with multiple submit buttons Hi, Thnaks for the tip reg LookupDispatchAction, but the problem is that I have the same name for different buttons in the same form. In that case, how will I know which button submitted that action?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thanks! Have a great day!! Srini - Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping
Re: Same action with multiple submit buttons
Again, how lookup dispatch action "works" is explained at http://www.michaelmcgrady.com/button/. But the options there are simpler, faster, superior. LookupDispatchAction is a dynosaur. On 12/21/05, Shiby Maria John <[EMAIL PROTECTED]> wrote: > > > Hi, > > I tried using the LookupDispatchAction for this... > But I am gettng this error.. > > Can anyone explain how this class works?? > > java.lang.NullPointerException > > org.apache.struts.actions.LookupDispatchAction.execute( > LookupDispatchAction.java:233) > > > org.apache.struts.action.RequestProcessor.processActionPerform( > RequestProcessor.java:480) > > > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java > :274) > > > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420) > > > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > ---Code > follows--- > jsp code:- > <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%> > <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%> > <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%> > > <% > response.setDateHeader("Expires", 1); > response.setHeader("Cache-control", "must-revalidate"); > %> > > > > DispatchAction Test > > > > > Enter a value in the > text1 > property="method">Submit1 > Enter a value in the > text2 > property="method">Submit2 > > > > > struts-config :- > parameter="method" > name="myDispForm"> >path="/jsp/dispatchActionResult.jsp" /> > > > MyDispatchAction:- > > public class MyDispatchAction extends LookupDispatchAction { > > @Override > protected Map getKeyMethodMap() { > Map map = new HashMap(); > map.put("Submit1", "submit1"); > map.put("Submit2", "submit2"); > return null; > } > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can lead a horse to water but you cannot make it float on its back." ~Dakota Jack~
Re: Same action with multiple submit buttons
Hi, I tried using the LookupDispatchAction for this... But I am gettng this error.. Can anyone explain how this class works?? java.lang.NullPointerException org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:233) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) ---Code follows--- jsp code:- <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%> <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%> <% response.setDateHeader("Expires", 1); response.setHeader("Cache-control", "must-revalidate"); %> DispatchAction Test Enter a value in the text1 Submit1 Enter a value in the text2 Submit2 struts-config :- MyDispatchAction:- public class MyDispatchAction extends LookupDispatchAction { @Override protected Map getKeyMethodMap() { Map map = new HashMap(); map.put("Submit1", "submit1"); map.put("Submit2", "submit2"); return null; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same action with multiple submit buttons
But I have different buttons with the same name "Change" ;( David Delbecq <[EMAIL PROTECTED]> To: "Struts Users Mailing List" cc: 12/21/2005 03:26 Subject: Re: Same action with multiple submit buttons PM Please respond to "Struts Users Mailing List" If you want same action, but different submit buttons, your other possiblity is DispatchAction + buttons like this: Doesn't use javascript, but can be very cumbersome with internationalization. Le Mercredi 21 Décembre 2005 10:42, Shiby Maria John a écrit : > > But that will require javascript, isnt it?? > > > > |-+--> > | | Pazhanikanthan Periasamy | > | | <[EMAIL PROTECTED]| > | | aritor.com>| > | | | > | | 12/21/2005 02:53 PM| > | | Please respond to "Struts | > | | Users Mailing List"| > | | | > |-+--> > >--| > | | > | To: "Struts Users Mailing List" | > | cc: | > | Subject: Re: Same action with multiple submit buttons | > >--| > > > > > Have a hidden attribute called method. > > Assign this param with the method name u need to call in the > DispatchAction Class based on the Button you have clicked and submit > the > form. > > Thanks and regards, > Pazhanikanthan. P > Project Leader, > Caritor (India) Pvt. Ltd., > Madras - 600 006 > Mob: 9886152717 > Extn: 40123 > > > > "Shiby Maria John" <[EMAIL PROTECTED]> > 12/21/2005 03:02 PM > Please respond to > "Struts Users Mailing List" > > > To > "Struts Users Mailing List" > cc > > Subject > Same action with multiple submit buttons > > > > > > > > Hi, > Thnaks for the tip reg LookupDispatchAction, but the problem is that I > have the same name for different buttons in the same form. > In that case, how will I know which button submitted that action?? > > > > > - > 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] > > -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - 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]
Re: Same action with multiple submit buttons
Actually there are a lot of superior ideas to this standard Struts fare. Try http://www.michaelmcgrady.com/button/ for some of them. On 12/21/05, David Delbecq <[EMAIL PROTECTED]> wrote: > > If you want same action, but different submit buttons, your other > possiblity is DispatchAction + > buttons like this: > > > > > > Doesn't use javascript, but can be very cumbersome with > internationalization. > Le Mercredi 21 Décembre 2005 10:42, Shiby Maria John a écrit : > > > > But that will require javascript, isnt it?? > > > > > > > > |-+--> > > | | Pazhanikanthan Periasamy | > > | | <[EMAIL PROTECTED]| > > | | aritor.com>| > > | | | > > | | 12/21/2005 02:53 PM| > > | | Please respond to "Struts | > > | | Users Mailing List"| > > | | | > > |-+--> > > > >--| > > > | > | > > | To: "Struts Users Mailing List" > | > > | > cc: > | > > | Subject: Re: Same action with multiple submit > buttons | > > > >--| > > > > > > > > > > Have a hidden attribute called method. > > > > Assign this param with the method name u need to call in the > > DispatchAction Class based on the Button you have clicked and submit > > the > > form. > > > > Thanks and regards, > > Pazhanikanthan. P > > Project Leader, > > Caritor (India) Pvt. Ltd., > > Madras - 600 006 > > Mob: 9886152717 > > Extn: 40123 > > > > > > > > "Shiby Maria John" <[EMAIL PROTECTED]> > > 12/21/2005 03:02 PM > > Please respond to > > "Struts Users Mailing List" > > > > > > To > > "Struts Users Mailing List" > > cc > > > > Subject > > Same action with multiple submit buttons > > > > > > > > > > > > > > > > Hi, > > Thnaks for the tip reg LookupDispatchAction, but the problem is that I > > have the same name for different buttons in the same form. > > In that case, how will I know which button submitted that action?? > > > > > > > > > > - > > 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] > > > > > > -- > David Delbecq > Royal Meteorological Institute of Belgium > > - > Pingouins dans les champs, hiver méchant > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can lead a horse to water but you cannot make it float on its back." ~Dakota Jack~
Re: Same action with multiple submit buttons
If you want same action, but different submit buttons, your other possiblity is DispatchAction + buttons like this: Doesn't use javascript, but can be very cumbersome with internationalization. Le Mercredi 21 Décembre 2005 10:42, Shiby Maria John a écrit : > > But that will require javascript, isnt it?? > > > > |-+--> > | | Pazhanikanthan Periasamy | > | | <[EMAIL PROTECTED]| > | | aritor.com>| > | | | > | | 12/21/2005 02:53 PM| > | | Please respond to "Struts | > | | Users Mailing List"| > | | | > |-+--> > > >--| > | >| > | To: "Struts Users Mailing List" >| > | cc: >| > | Subject: Re: Same action with multiple submit buttons >| > > >--| > > > > > Have a hidden attribute called method. > > Assign this param with the method name u need to call in the > DispatchAction Class based on the Button you have clicked and submit > the > form. > > Thanks and regards, > Pazhanikanthan. P > Project Leader, > Caritor (India) Pvt. Ltd., > Madras - 600 006 > Mob: 9886152717 > Extn: 40123 > > > > "Shiby Maria John" <[EMAIL PROTECTED]> > 12/21/2005 03:02 PM > Please respond to > "Struts Users Mailing List" > > > To > "Struts Users Mailing List" > cc > > Subject > Same action with multiple submit buttons > > > > > > > > Hi, > Thnaks for the tip reg LookupDispatchAction, but the problem is that I > have the same name for different buttons in the same form. > In that case, how will I know which button submitted that action?? > > > > > - > 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] > > -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same action with multiple submit buttons
Yes. You will need Java script for this. Thanks and regards, Pazhanikanthan. P Project Leader, Caritor (India) Pvt. Ltd., Madras - 600 006 Mob: 9886152717 Extn: 40123 "Shiby Maria John" <[EMAIL PROTECTED]> 12/21/2005 03:12 PM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject Re: Same action with multiple submit buttons But that will require javascript, isnt it?? |-+--> | | Pazhanikanthan Periasamy | | | <[EMAIL PROTECTED]| | | aritor.com>| | | | | | 12/21/2005 02:53 PM| | | Please respond to "Struts | | | Users Mailing List"| | | | |-+--> >--| | | | To: "Struts Users Mailing List" | | cc: | | Subject: Re: Same action with multiple submit buttons | >--| Have a hidden attribute called method. Assign this param with the method name u need to call in the DispatchAction Class based on the Button you have clicked and submit the form. Thanks and regards, Pazhanikanthan. P Project Leader, Caritor (India) Pvt. Ltd., Madras - 600 006 Mob: 9886152717 Extn: 40123 "Shiby Maria John" <[EMAIL PROTECTED]> 12/21/2005 03:02 PM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject Same action with multiple submit buttons Hi, Thnaks for the tip reg LookupDispatchAction, but the problem is that I have the same name for different buttons in the same form. In that case, how will I know which button submitted that action?? - 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]
Re: Same action with multiple submit buttons
But that will require javascript, isnt it?? |-+--> | | Pazhanikanthan Periasamy | | | <[EMAIL PROTECTED]| | | aritor.com>| | | | | | 12/21/2005 02:53 PM| | | Please respond to "Struts | | | Users Mailing List"| | | | |-+--> >--| | | | To: "Struts Users Mailing List" | | cc: | | Subject: Re: Same action with multiple submit buttons | >--| Have a hidden attribute called method. Assign this param with the method name u need to call in the DispatchAction Class based on the Button you have clicked and submit the form. Thanks and regards, Pazhanikanthan. P Project Leader, Caritor (India) Pvt. Ltd., Madras - 600 006 Mob: 9886152717 Extn: 40123 "Shiby Maria John" <[EMAIL PROTECTED]> 12/21/2005 03:02 PM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject Same action with multiple submit buttons Hi, Thnaks for the tip reg LookupDispatchAction, but the problem is that I have the same name for different buttons in the same form. In that case, how will I know which button submitted that action?? - 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]
Re: Same action with multiple submit buttons
Have a hidden attribute called method. Assign this param with the method name u need to call in the DispatchAction Class based on the Button you have clicked and submit the form. Thanks and regards, Pazhanikanthan. P Project Leader, Caritor (India) Pvt. Ltd., Madras - 600 006 Mob: 9886152717 Extn: 40123 "Shiby Maria John" <[EMAIL PROTECTED]> 12/21/2005 03:02 PM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject Same action with multiple submit buttons Hi, Thnaks for the tip reg LookupDispatchAction, but the problem is that I have the same name for different buttons in the same form. In that case, how will I know which button submitted that action?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]