Thanks for the suggestions.  

Jim's idea is kind of what I'm doing now.  Although I'm using my own
makeshift isActionCancelled (request, mapping) method.  I keep track of the
last action's path (in the session) and when a 'cancel' parameter is present
in the request - I call the above method.  I can then verify that the
'cancel' relates to this action, by checking that the current action's path
(mapping.getPath()) is the same as the last action.  In my application, the
last action prior to displaying a form will always be the same action that
the form submits to.

This overcomes the problem of the 'cancel' parameter still being in the
request when it reaches the next action down the line.

Probably overly-complex, but it's working and more importantly - I can
understand why it's working!.  Now if only I could explain all these things
to the poor student who'll be taking over my project in September. :)  

Lindsay
 

 -----Original Message-----
From:   Jim Crossley [mailto:[EMAIL PROTECTED]] 
Sent:   02 May 2002 15:08
To:     Struts Users Mailing List
Subject:        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]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to