struts-user mailing list archives

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

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

<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.

Thanks!
Abdullah

-----Original Message-----
From: Brandon Mercer [mailto:brandon@eutonian.com]
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. 
Brandon

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message