its a struts bug and it is fixed in the comming version.

but in appfuse 2.0 it is not fixed jet.

tibi

Matt Raible wrote:
> Is this a Struts 2 bug or an AppFuse one? If the template is in
> Struts, you should probably file an issue in Struts' JIRA.
>
> https://issues.apache.org/struts/secure/Dashboard.jspa
>
> Matt
>
> On 11/13/07, tibi <[EMAIL PROTECTED]> wrote:
>   
>> found it
>>
>> copy the form-close-validate.ftl to your template/xhtml dir
>> to overwrite the struts file.
>>
>> and change the int part to:
>>             <#elseif validator.validatorType = "int">
>>             if (field.value != null) {
>>                 if (<#if validator.min?exists>parseInt(field.value) <
>>                      ${validator.min?string("#") }<#else>false</#if> ||
>>                         <#if validator.max?exists>parseInt(field.value) >
>>                            ${validator.max?string("#")
>> }<#else>false</#if>) {
>>                     addError(field, error);
>>                     errors = true;
>>                 }
>>             }
>>
>> this should be fixed in the 2.1.1 version i gues...
>>
>>
>> have fun,
>>
>> tibi
>>
>> tibi wrote:
>>     
>>> found it in the struts core jar file.
>>>
>>> tibi
>>>
>>> tibi wrote:
>>>
>>>       
>>>> ok more google:
>>>>
>>>> i found this:
>>>> http://www.nabble.com/-jira--Created%3A-%28WW-2254%29-Stringlength-validator-xhtml-template-should-be-locale-independent-tf4632858.html#a13230279
>>>>
>>>> The freemarker template that generates client side validation for the
>>>> xhtml theme (template/xhtml/*form*-*close*-*validate*.*ftl*) generates
>>>> the javascript functions for different validators.
>>>>
>>>> In the case of the stringlength validator there are a series of lines of
>>>> code that are generated that may not work in locales that are not
>>>> English. For example, if you define the maxLength to be 1000.
>>>>
>>>> value.length > ${validator.maxLength}
>>>>
>>>> in a Spanish locale outputs
>>>>
>>>> value.length > 1,000
>>>>
>>>> Which results in a string comparison rather than a number comparison.
>>>>
>>>>
>>>>
>>>>
>>>> but in template/xhtml there is no form-close-validate.ftl?
>>>> any idea were this file is??
>>>>
>>>>
>>>> thanks,
>>>>
>>>> tibi
>>>>
>>>>
>>>>
>>>>
>>>> tibi wrote:
>>>>
>>>>
>>>>         
>>>>> this generated js code should it come from the *validation.js??
>>>>>
>>>>> *and where can i find this file??
>>>>>
>>>>> thanks,
>>>>>
>>>>> tibi
>>>>>
>>>>> tibi wrote:
>>>>>
>>>>>
>>>>>
>>>>>           
>>>>>> hi list,
>>>>>>
>>>>>> i use the struts validator (appfuse 2.0m5 struts hibernate and spring)
>>>>>>
>>>>>> when i want to validate an int i have no problem when the int is between
>>>>>> 0 and 999
>>>>>> but when i go over 1000 the javascript generates a code like this:
>>>>>>
>>>>>> // field name: subscriber.user.lastName
>>>>>>         // validator name: int
>>>>>>         if (form.elements['subscriber.user.lastName']) {
>>>>>>             field = form.elements['subscriber.user.lastName'];
>>>>>>             var error = "bar must be between 6 and 2010, current value
>>>>>> is .";
>>>>>>             if (field.value != null) {
>>>>>>                 if (parseInt(field.value) <
>>>>>>                      6 ||
>>>>>>                         parseInt(field.value) >
>>>>>>                            2,010) {
>>>>>>                     addError(field, error);
>>>>>>                     errors = true;
>>>>>>                 }
>>>>>>             }
>>>>>>         }
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2010 becomse 2,010 wich will not work.
>>>>>>
>>>>>> any one an idea??
>>>>>>
>>>>>> thanks,
>>>>>>
>>>>>> tibi
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> 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]
>>>
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> 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