struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abdullah Jibaly" <>
Subject RE: Two cancel buttons in one form
Date Tue, 22 Mar 2005 16:12:59 GMT

The problem is that Struts does not give you access to the value of the cancel button when

<html:cancel value="Return" />

It only gives you the isCancelled method which indicated whether or not it was set.

I guess I'll just get it manually as mentioned in the other post.


-----Original Message-----
From: Brandon Mercer []
Sent: Tuesday, March 22, 2005 10:02 AM
To: Struts Users Mailing List
Subject: Re: Two cancel buttons in one form

Abdullah Jibaly wrote:

>Hi all,
>I want to have two cancel buttons in a form, however I run into the problem of not being
able to distinguish which one is being pressed (one cancels the whole operation and the other
returns to the first screen). The reason is that they both use the Globals.CANCEL_KEY parameter.
What is the best way to get around this?
There sure is.  Have one button set one value, and the other button set
another.  In your Action, look at which value you've been passed and act
accordingly.  So replace your Globals.CANCEL_KEY with
Globals.CANCEL_RETURN and Globals.CANCEL_CANCEL or some such and that
should work. 

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message