You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mohamed SIDI <mh...@gmail.com> on 2011/03/14 10:34:46 UTC

Validate filed if filled

Hi all,

In my Web User Interface, I have a field witch is not a mandatory filed, for
this filed I want to define a validation rule in my ActionName-validator.xml
only when it was filled, somneone can help to do that

BW

Re: Validate filed if filled

Posted by Dave Newton <da...@gmail.com>.
Or a custom validator (that could be chained with others), sort of a
"validateIfFilled" type thing.

Dave

On Mon, Mar 14, 2011 at 8:58 AM, Paul Zepernick
<pz...@commercebenefitsgroup.com> wrote:
> If you need to use the XML you might be able to use the field expression
> validator.  It probably would be easier to just put it in the validate()
> though as suggested.
>
>
> http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html
>
> Paul
>
>
>
> -----Original Message-----
> From: Paweł Wielgus [mailto:poulwiel@gmail.com]
> Sent: Monday, March 14, 2011 6:32 AM
> To: Struts Users Mailing List
> Cc: Mohamed SIDI
> Subject: Re: Validate filed if filled
>
> Hi Mohamed,
> i would do it in actions validate method,
> not in xml.
> But that's just my oppinion.
>
> Best greetings,
> Paweł Wielgus.
>
>
> 2011/3/14 Mohamed SIDI <mh...@gmail.com>:
>> Hi all,
>>
>> In my Web User Interface, I have a field witch is not a mandatory filed,
>> for
>> this filed I want to define a validation rule in my
>> ActionName-validator.xml
>> only when it was filled, somneone can help to do that
>>
>> BW
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> The information contained in this transmission contains
> confidential information that is legally privileged. This information is
> intended only for the use of the individual or entity named above. The
> authorized recipient of this information is prohibited from disclosing this
> information to any other party unless required to do so by law or regulation
> and is required to destroy the information after its stated need has been
> fulfilled.
>
> If you are not the intended recipient, you are hereby notified that any
> disclosure, copying, distribution, or action taken in reliance on the
> contents of these documents is strictly prohibited. If you have received
> this information in error, please notify the sender immediately by return
> email and arrange for the return or destruction of these documents.
>
>
>
> ---------------------------------------------------------------------
> 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


RE: Validate filed if filled

Posted by Paul Zepernick <pz...@commercebenefitsgroup.com>.
If you need to use the XML you might be able to use the field expression validator.  It probably would be easier to just put it in the validate() though as suggested.


http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html

Paul



-----Original Message-----
From: Paweł Wielgus [mailto:poulwiel@gmail.com] 
Sent: Monday, March 14, 2011 6:32 AM
To: Struts Users Mailing List
Cc: Mohamed SIDI
Subject: Re: Validate filed if filled

Hi Mohamed,
i would do it in actions validate method,
not in xml.
But that's just my oppinion.

Best greetings,
Paweł Wielgus.


2011/3/14 Mohamed SIDI <mh...@gmail.com>:
> Hi all,
>
> In my Web User Interface, I have a field witch is not a mandatory filed, for
> this filed I want to define a validation rule in my ActionName-validator.xml
> only when it was filled, somneone can help to do that
>
> BW
>

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


The information contained in this transmission contains confidential  information that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to destroy the information after its stated need has been fulfilled.
If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of these documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by return email and arrange for the return or destruction of these documents.


Re: Validate filed if filled

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Mohamed,
i would do it in actions validate method,
not in xml.
But that's just my oppinion.

Best greetings,
Paweł Wielgus.


2011/3/14 Mohamed SIDI <mh...@gmail.com>:
> Hi all,
>
> In my Web User Interface, I have a field witch is not a mandatory filed, for
> this filed I want to define a validation rule in my ActionName-validator.xml
> only when it was filled, somneone can help to do that
>
> BW
>

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