RE: How do I pass an ActionForward's path into a button's onclick() h andler
Try this: html:cancel value=Cancel onclick=javascript:location='/do/home' / Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 1:26 PM I have a form and it has a 'confirm' and a 'cancel' button. The 'confirm' button submits to the Action class. I'd like the 'cancel' button to redirect user to another Action, which has a global-forward named 'home'. Here's what I'm attempting... html:submit property=irrelevant value=Cancel onclick=javascript:location.href='html:rewrite forward=home/';/ This does not work at all. Does anyone know how I could do this? Many thanks. Lindsay -- To unsubscribe, e-mail: mailto:[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]
Re: How do I pass an ActionForward's path into a button's onclick () h andler
Or put this in your form: html:cancel/ And this in your Action: if (isCancelled(request)) return mapping.findForward(home); -- Jim Galbreath, Mark [EMAIL PROTECTED] writes: Try this: html:cancel value=Cancel onclick=javascript:location='/do/home' / Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 1:26 PM I have a form and it has a 'confirm' and a 'cancel' button. The 'confirm' button submits to the Action class. I'd like the 'cancel' button to redirect user to another Action, which has a global-forward named 'home'. Here's what I'm attempting... html:submit property=irrelevant value=Cancel onclick=javascript:location.href='html:rewrite forward=home/';/ This does not work at all. Does anyone know how I could do this? Many thanks. Lindsay -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How do I pass an ActionForward's path into a button's onclick() h andler
you could just detect the kind of submit in your action and then if it's a cancel, forward to the other action. But if I understand what you're saying, you could just check the submit type and global forward from the first action. bp -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 1:26 PM To: [EMAIL PROTECTED] Subject: How do I pass an ActionForward's path into a button's onclick() h andler I have a form and it has a 'confirm' and a 'cancel' button. The 'confirm' button submits to the Action class. I'd like the 'cancel' button to redirect user to another Action, which has a global-forward named 'home'. Here's what I'm attempting... html:submit property=irrelevant value=Cancel onclick=javascript:location.href='html:rewrite forward=home/';/ This does not work at all. Does anyone know how I could do this? Many thanks. Lindsay -- To unsubscribe, e-mail: mailto:[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]
RE: How do I pass an ActionForward's path into a button's onclick () h andler
I have tried detecting what type of submit (e.g. cancel) in the action and then dealing with it from there (i.e. go back to another action). But when you do such detection in all your actions, then (unless you redirect) the parameter is still there when you reach your forwarded-to action - and this is not desirable in my case - because that action will then see this 'cancel' parameter and go back to another action, and so on. I find explaining this very difficult - does it show?! I really need a mechanism for handling back or cancel requests effectively. There's no way I'm using history.back() because it might not point to the right place. I think I'll just go home and lose some sleep over it. -Original Message- From: Bill Page [mailto:[EMAIL PROTECTED]] Sent: 01 May 2002 18:31 To: Struts Users Mailing List Subject:RE: How do I pass an ActionForward's path into a button's onclick () h andler you could just detect the kind of submit in your action and then if it's a cancel, forward to the other action. But if I understand what you're saying, you could just check the submit type and global forward from the first action. bp -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 1:26 PM To: [EMAIL PROTECTED] Subject: How do I pass an ActionForward's path into a button's onclick() h andler I have a form and it has a 'confirm' and a 'cancel' button. The 'confirm' button submits to the Action class. I'd like the 'cancel' button to redirect user to another Action, which has a global-forward named 'home'. Here's what I'm attempting... html:submit property=irrelevant value=Cancel onclick=javascript:location.href='html:rewrite forward=home/';/ This does not work at all. Does anyone know how I could do this? Many thanks. Lindsay -- To unsubscribe, e-mail: mailto:[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:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]