The most elegant method is to give a SPECIAL name to "delete"  button.
It must looks like:

<s:submit name="method:delete" value="Delete" /> 
and
<s:submit value="Execute" />

I found it in 
http://www.nabble.com/struts2-validation-for-only-one-method-in-action-tf3267302.html
this  post by  Ian Roughley




an Roughley wrote:
> 
> you can always use <s:submit name="method:delete" value="Delete" /> and
> <s:submit value="Execute" /> - then you don't need the logic to
> determine which button was clicked in the execute() method, and you can
> use the validation config below. 
> 


Original Post 


Igor Vlasov wrote:
> 
> Hello.
> 
> I have 
> <s:form action="customer" method='post' theme="xhtml"  >
>  <s:textfield name="customer.cus_email"  size="20" label="E-mail" /> 
>  <s:submit value="OK." name="VIEW"    theme="simple">   </s:submit> 
>   <s:submit value="Delete" name="DEL" theme="simple"></s:submit>
> </s:form>
> and 
> 
> CustomerCRUD-validation:
> <validators>
>   <field name="customer.cus_email">
>     <field-validator type="email">
>       <message>Error E-mail</message>
>     </field-validator>
>   </field>
> </validators>
> 
> 
> 
> How to DISABLE server side validation when i click on "DELETE" button and
> have empty email field value ?
> 

-- 
View this message in context: 
http://www.nabble.com/Disable-validation-when-%22delete%22-button-is-pressed-tf4640820.html#a13269390
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to