• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

message required

 
rosaria italia
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, is it possible to pass field's name for validator "required" so I to print next to field validation?
My code jsp
...
<h utputText value="USERNAME" /><h:message for="username" ></h:message>
<h:inputText id="username" value="#{user.username}" required="true"><h:message for="username" style="color: red" /></h:inputText>

My file with custum messages is:
...
javax.faces.component.UIInput.REQUIRED=Value is required.
...

I would that message is: Value for "username" is required.
Thanks.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It takes some work, but this reference explains how to do it:
http://www.oracle.com/technology/pub/articles/masterj2ee/j2ee_wk7.html
 
Richard Green
Ranch Hand
Posts: 536
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try

javax.faces.component.UIInput.REQUIRED=Value is required for {1}.
 
rosaria italia
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I have tried both suggestions but I didn't resolve my problem, would you give me an other explanation, please?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What went wrong whem you tried what was suggested in the reference I posted?
 
rosaria italia
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff, now works even if not completely !!! Thanks very much your suggestion.
 
rosaria italia
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm using PhaseListener, but why in my Application are showed both validation's errors (my personalize messages and default's messages)?
Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic