-
1. Re: JSF requiredMessage does not work with seam bundle
rlhr Nov 29, 2006 4:38 AM (in response to yj4jboss)I ran in that problem few days ago while struggling with @NotNull validation.
I then wanted to use the requiredMessage attribute and could not manage to have it work
After looking at the code, I discovered that it is not implemented in myfaces-core-1.1.4!
I don't know if there are any implementation of javax.faces fully implements the standard and are compatible with seam. -
2. Re: JSF requiredMessage does not work with seam bundle
yj4jboss Nov 29, 2006 5:28 AM (in response to yj4jboss)So is there any workaround for this ? I guess the Validator Message also would not work ??
-
3. Re: JSF requiredMessage does not work with seam bundle
rlhr Nov 29, 2006 8:30 AM (in response to yj4jboss)You can look at these 2 links (they explained a lot about validations):
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=90636
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=93507
So my understanding at this point is that the jsf framework will not call any validator when a value is null (I guess this is because there is no need to validate anything in that case).
I believe the reason for this is that in case of a null value, we either accept it (attribute required=false) or we refuse it (required=true).
Now since the attribute requiredMessage is not implemented, I can see to possible fix:
1- override javax.faces.component.UIInput.REQUIRED in your messages.propertiesjavax.faces.component.UIInput.REQUIRED = My error message
That will replace the ugly "Validator Error" message. But if you have 5 inputText in your page, you'll get 5 times this message...
2 - You can extend any components (inputText,...) you need to use and implement the missing attribute.
Maybe there are other solutions. I'm still looking into that problem myself.
Richard -
4. Re: JSF requiredMessage does not work with seam bundle
yj4jboss Nov 29, 2006 10:13 AM (in response to yj4jboss)Thnx for the tips Richard,
I will try to test these by next week and let you know of any progress. Until then keep me posted.
Regards,
Yogesh