jQuery in Action, 2nd edition*
The moose likes JSF and the fly likes how to read the label name for a component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "how to read the label name for a component" Watch "how to read the label name for a component" New topic
Author

how to read the label name for a component

Srikanth Nittala
Greenhorn

Joined: Sep 24, 2006
Posts: 22
Hello,

I want to read the label name of a component, say inputText.
The reason is that i have a requirement to display error messages like 'labelName must be a 10 digit number". I am using JSF 1.1.




I want to read this label name in my Validator method:




Thanks,
Srikanth
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Use the 'label' attribute of the input component.
Srikanth Nittala
Greenhorn

Joined: Sep 24, 2006
Posts: 22
Did you mean to use something like:



Since i am using JSF 1.1 there is no label attribute to the inputText component.

-Srikanth>
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Then add it using f:attribute.
Srikanth Nittala
Greenhorn

Joined: Sep 24, 2006
Posts: 22
Thanks. I got the idea now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to read the label name for a component
 
Similar Threads
Custom Component : Missing Update Model Phase?
validator not invoke
Custom input validator
JSF validation not validating
empty space validation