Re: Translation of fieldName in annotated validations

2013-12-20 Thread JOSE L MARTINEZ-AVIAL
Hi, Just reviewing old things, I discovered I didn't answer you. The think is that the same effect can be obtained using the already existing functionality. I can create the following annotation to validate a field: @RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "phoneCountry

Re: Translation of fieldName in annotated validations

2013-09-30 Thread Lukasz Lenart
2013/9/25 JOSE L MARTINEZ-AVIAL : > Well, I have found a workaround that is not much of a hacking. The > annotations has a messageParameters that is evaluated against the > valuestack. Since the action is in the valuestack, and it implements > ActionSupport,I can pass a parameter that is a call to

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
Well, I have found a workaround that is not much of a hacking. The annotations has a messageParameters that is evaluated against the valuestack. Since the action is in the valuestack, and it implements ActionSupport,I can pass a parameter that is a call to getText. requiredStrings =

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
I just created the issue https://issues.apache.org/jira/browse/WW-4208. I maybe able to provide a patch for this, if I have time for it. 2013/9/25 JOSE L MARTINEZ-AVIAL > I will open a ticket. My idea is to add a parameter to the annotation > called keyArgs, which would be a String array. It w

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
I will open a ticket. My idea is to add a parameter to the annotation called keyArgs, which would be a String array. It would be used as follows: requiredStrings = {@RequiredStringValidator(type = ValidatorType.SIMPLE, keyArgs={"email","one","two"}

Re: Translation of fieldName in annotated validations

2013-09-25 Thread Lukasz Lenart
2013/9/25 JOSE L MARTINEZ-AVIAL : > I have javascript controls for the client-side validation, but we also want > to implement server-side validation. I'm not criticizing the framework, I > really really like it. I'm just wondering if the validations could be a > little more flexible to allow reusi

Re: Translation of fieldName in annotated validations

2013-09-25 Thread Chris
Objet : Re: Translation of fieldName in annotated validations I have javascript controls for the client-side validation, but we also want to implement server-side validation. I'm not criticizing the framework, I really really like it. I'm just wondering if the validations could be a l

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
gt; > > > De : JOSE L MARTINEZ-AVIAL > À : Struts Users Mailing List > Envoyé le : Mercredi 25 septembre 2013 12h51 > Objet : Re: Translation of fieldName in annotated validations > > > Yes, what I would like is to define a message fo

Re: Translation of fieldName in annotated validations

2013-09-25 Thread Chris
-AVIAL À : Struts Users Mailing List Envoyé le : Mercredi 25 septembre 2013 12h51 Objet : Re: Translation of fieldName in annotated validations Yes, what I would like is to define a message for each validator that could be reused with any field just by having the fieldname translated. Let's

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
Yes, what I would like is to define a message for each validator that could be reused with any field just by having the fieldname translated. Let's say I have a form to create an user, with fields First name, Last name and Email, where all the fields are required. I would define the following prope

Re: Translation of fieldName in annotated validations

2013-09-25 Thread Lukasz Lenart
2013/9/25 JOSE L MARTINEZ-AVIAL : > Hello, >I have an Action that receives a parameter *email *on a bean *event*. So > basically the parameter is send to the server with name "* > event.email=jlmagcgmail.com*"'. The bean and the parameter are created > correctly, so this part works ok. Now I wa

Translation of fieldName in annotated validations

2013-09-24 Thread JOSE L MARTINEZ-AVIAL
Hello, I have an Action that receives a parameter *email *on a bean *event*. So basically the parameter is send to the server with name "* event.email=jlmagcgmail.com*"'. The bean and the parameter are created correctly, so this part works ok. Now I want to validate the input using annotations.