Hi,
Just for the record, I have contrived a particularly nasty work-around for this problem and share it in case anyone ever ends up as desperate as me!


To recap, I have 3 buttons on a form including a cancel button for which there should be no validation.

Because I have implemented a LookupDispatchAction class to handle these buttons, I cannot just use the <html:cancel> tag 'as is' because I get the following exception (my method param is called 'method'):

javax.servlet.ServletException: Request[/createContact] does not contain handler parameter named method

If you include property="method" with the <html:cancel> tag, you lose the exception but validation still takes place.

So what I have done (if you will excuse the fish-heads) is:

Use a standard html hidden tag (the <html:hidden> struts tag moans about not having getter for the property x) with a dummy name:

 <input type=hidden name="x" />

Have your cancel button call some JavaScript:

<html:cancel property="method" onclick="return sendCancel()"><bean:message key="button.cancel"/></html:cancel>

and the JavaScript is:

function sendCancel()
{
document.forms[0].elements[0].name="org.apache.struts.taglib.html.CANCEL"
return true;
}

I have tried all the other suggestions in every combination but can't get anything more elegant to work. This works but I'm not looking forward to the code review!

Regards,
Andy

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger



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



Reply via email to