Re: S2: validation notation on DATE (object that has a Date field)

2008-06-24 Thread Jim Kiley
Have you set the validateAnnotatedMethodOnly property on the validation interceptor in your struts.xml? ( http://struts.apache.org/2.0.11.1/docs/validations-annotation.html) On Tue, Jun 24, 2008 at 10:21 AM, xianwinwin <[EMAIL PROTECTED]> wrote: > > I tried to do something with RequiredFieldValid

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-24 Thread xianwinwin
I tried to do something with RequiredFieldValidator, @Validations( stringLengthFields [EMAIL PROTECTED](type = ValidatorType.SIMPLE, trim = true, minLength="1" , fieldName = "empl.name", message = "required field")}, requiredFields =[EMAIL PROTECTED](type = Validat

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-24 Thread Jim Kiley
Fair enough. Is this something you could solve with a validate() method on your action, assuming that your action is ValidationAware? On Tue, Jun 24, 2008 at 9:45 AM, xianwinwin <[EMAIL PROTECTED]> wrote: > > But that means that ALL objects type Empl will have a mandatory field > called > DOB. I

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-24 Thread xianwinwin
But that means that ALL objects type Empl will have a mandatory field called DOB. I wish to have more flexibility by choosing the mandatory field based on the user's action. Jim Kiley wrote: > > If "empl" is a field on your action, and your JSP references the field as > "empl.date," put the

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-24 Thread Jim Kiley
If "empl" is a field on your action, and your JSP references the field as "empl.date," put the validation on the setter for the date field of Empl, rather than on the action. On Tue, Jun 24, 2008 at 9:06 AM, xianwinwin <[EMAIL PROTECTED]> wrote: > > hi Lukasz > > In your example, you wrote: > > P

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-24 Thread xianwinwin
hi Lukasz In your example, you wrote: Private Date today; @RequiredFieldValidator(message = "Date is required") public Date getToday() { return today; } this works great also in my application, but my question is different, I don't have a field called today, I have an obj

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-23 Thread Lukasz Lenart
Hi, > This also works on my end *BUT* the Date in part of an Object (not a field) Could you show your configuration? Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-23 Thread xianwinwin
This also works on my end *BUT* the Date in part of an Object (not a field) so I have Employee empl; with Date dob, thank you Lukasz Lenart wrote: > >> I did, and it doesn't work, when I click submit, I immediately get a red >> message next to the required fields...but not next to the dat

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-23 Thread Lukasz Lenart
> I did, and it doesn't work, when I click submit, I immediately get a red > message next to the required fields...but not next to the date. That strange, I made a test and it works, I've annotated at setter level @RequiredFieldValidator(message = "Date is required") public Date getToday(

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-19 Thread xianwinwin
I did, and it doesn't work, when I click submit, I immediately get a red message next to the required fields...but not next to the date. Lukasz Lenart wrote: > > Hi, > > Did you try > @RequiredFieldValidator(type = ValidatorType.SIMPLE, fieldName = > "customfield", message = "You must enter

Re: S2: validation notation on DATE (object that has a Date field)

2008-06-18 Thread Lukasz Lenart
Hi, Did you try @RequiredFieldValidator(type = ValidatorType.SIMPLE, fieldName = "customfield", message = "You must enter a value for field.") ? Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROT