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
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
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
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
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
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
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
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
> 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(
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
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
11 matches
Mail list logo