I just called my validation file ActionClassName-validation.xml, don't
even know what this alias is... and validation seems to work fine.

As far as I recall (can't check it right now) I did not have to set
validate="true" for my form.
I am also using the ajax theme but I set it using the <s:head> tag,
while I set the theme of the form to simple. This is because I just want
the datetimepicker to work, but I don't want the <s:form> to create
markup because I want to create it manually.
This means also that validation errors are not displayed next to the
respective field but I use the <s:fielderror> tag instead, it creates an
 unordered list with all validation error messages.

Hope this helps you a little.

Torsten

Olivier THIERRY wrote:
> OK, it works now. Not perfectly, but it works.
> 
> Actually I had to name my validation file
> CreerDmandeAbsenceAction-submitCreerDemandeAbsence-validation.xml,
> beginning
> with an uppercase letter. Then I put this file in my action package as you
> said. But it worked only when I set the validate attribute of my form to
> true in the JSP ... When I set this attribute to false, the validation
> doesn't work at all. Maybe it's because I use Ajax theme ?
> But I still have problems, when i submit my form :
> - I have a Javascript popup for each datetimepicker in my form (message :
> "TypeError: row.cells has no properties")
> - There is no validation on radio buttons ...
> - When I submit my form a second time, the errors list is not reseted, so
> the remaining errors are displayed twice ...
> - The label for required fields turns to red ... but only for text fields
> and selects, but not for datetimepickers, radio buttons or textareas ...
> 
> Moreover, is there a way to group the error messages on top of the form,
> and
> not besides each field (I know it was the default behaviour with Struts 1
> but can't find how to do it with Struts 2).
> 
> Thanks for your help ;)
> 
> Olivier
> 
> 2007/5/9, Guillaume Carré <[EMAIL PROTECTED]>:
>>
>> 2007/5/9, Olivier THIERRY <[EMAIL PROTECTED]>:
>> > Well, it still doesn't work :(
>> > A few questions :
>> > - Do I have to put the xxx-validation.xml files in a specific directory
>> ? I
>> > put them in the WEB-INF/classes directory ...
>>
>> you have to put it in the same package than your action
>>
>> > - And has the first part of the validation xml file to be the action
>> name
>> > (name attribute in struts.xml file) or the action class name ? I didn't
>> find
>> > it clear in the documentation ...
>>
>> your validation file needs to have the following name:
>> ActionName-alias-validation.xml
>>
>> in your example:
>> creerDemandeAbsenceAction-submitCreerDemandeAbsence-validation.xml
>> -- 
>> Guillaume Carré
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 

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

Reply via email to