andy wix wrote:
Hi,
Sorry to harp on about this but I am sure html:cancel must work, as it is fundamental to the way sites flow!
It says the following about the html:cancel 'property' attribute in the Html Tag Developer Guide:
"WARNING - If you set this attribute to a value other than the default, this will NOT be recognized as the cancel key by the Struts controller servlet or the Action.isCancelled() method. You will need to do your own cancel detection".
But nearly always a developer will be overriding this property with a value so that they can distinguish which button was clicked by the user to satisfy the Dispatch Action class. (I say this as I assume there will often be a submit button as well that should invoke validation).
Why would a developer be overriding the property value for html:cancel? It makes sense to do it for html:submit tags to be able to detect which submit button was clicked when the execute() method of your action class is called. I just set all of the html:submit tags to use the same property name, such as "MyAction", and then I retrieve that from the HTTP request that is passed in to execute(). First, however, I test the return value of isCancelled() to see if html:cancel was clicked, and if it is false, then I test value of "MyAction" to find out which html:submit button was clicked.
If you don't override the property value for html:cancel, you are observing that the Struts Validator plug-in still tries to validate the fields on the submitted form? Is this correct?
-- Chuck Chopp
ChuckChopp (at) rtfmcsi (dot) com http://www.rtfmcsi.com
RTFM Consulting Services Inc. 864 801 2795 voice & voicemail 103 Autumn Hill Road 864 801 2774 fax Greer, SC 29651
Do not send me unsolicited commercial email.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]