165 total views, 5 views today

JSF OutputLabel Example

The JSF OutputLabel will attach a Label to an input field component. The h:outputLabel renders an HTML <LABEL> component in the browser. The FOR attribute in the OutputLabel maps to the ID attribute of the Input component. Here below is the JSF components and its corresponding HTML component

JSF => <h:outputLabel value=”Username: ” for=”text1″ />

HTML => <label for=”text1″>Username</label>

 

JSF h:OutputLabel Example

Below is the JSF page renders a Label for a text field. Note the value in the FOR of h:outputLabel is matched with id of h:inputText component

 

 

 

Below is how the page rendered in the browser. The LABEL component provides a nice mouse control. If you see below, When I click on the text ‘Username’ the mouse cursor moves to the text field

 

JSF_OutputLabel JSF OutputLabel Example
 

govindan JSF OutputLabel Example
Connect me

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply šŸ™‚
govindan JSF OutputLabel Example
Connect me
By | 2017-11-23T02:52:51+00:00 November 23rd, 2017|Categories: JSF|Tags: , , , |0 Comments
Like us on Facebook.
Connect!