Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Jsf JSF inputText tag

Related Tutorials


 
 

Share on Google+Share on Google+

JSF inputText tag

Advertisement
This tag is used to create html input element which has the type text. It creates input text field where text can be entered.

JSF inputText tag

    

This tag is used to create html input element which has the type "text". It creates input text field where text can be entered.

Code Description :

<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:view>
  <html>
  <head><title>jsf h:inputText example</title></head>
  <body>
   <h:inputText />
  </body>
  </html>
</f:view>

Rendered Output :

Html Source Code :

<html>
  <head><title>jsf h:inputText example</title></head>
   <body>
   <input type="text" name="_id0" />
   </body>
</html>

 This tag contains some attributes that are discussed below :

  • id : This attribute is used to uniquely identify the element within the closest container. 
  • rendered : Its a boolean attribute. Its default value is true. It determines whether this component should be rendered or not.
  • binding : It takes the value binding expression that is used to link the component to the property of the backing bean.
  • dir : It is used to set the direction of the text to be displayed. It can take two values LTR(left to right) and RTL (right to left). 
  • lang : It is used to set the base language of the component when displayed. 
  • style : It is used to set the CSS style definition for the component.
  • accesskey : This is standard html attribute. It is used to set the access key for the element which is used to send the focus to the element when pressed. 
  • alt : This is used as an alternate text that is displayed when browser is not able to display the element. 
  • converter : This specifies the converter for the component. This can be static value or EL expression . 
  • disabled : Its a boolean attribute. This is used to disable the element to receive focus, when it is set to true. 
  • immediate : Its a boolean attribute. It is used to identify during which phase value change event should occur. If this attribute is set to true then in place of firing the event during the process validation phase, these event are sent immadiately at the end of apply request values phase. 
  • maxlength : It is used to set the maximum length of character that can be input into the text field.
  • onblur : It is used to set the java script code to execute when focus is lost from the element.
  • onchange : It is used to set the java script code to execute when element is modified. 
  • size : It is used to set  the width (in character) of the component.
  • title : It is the standard html attribute. It is used to set the tooltip text for this component.
  • styleClass : It is used to set the CSS class for the component. 
  • onclick : Script to be invoked when the element is clicked. 
  • ondblclick : It is used for Java Script code to be invoked when the element is double-clicked. 
  • onmousedown : It is used for Java Script code to be invoked when the pointing device is pressed over this element. 
  • onmouseup : It is used for Java Script code to be invoked when the pointing device is released over this element. 
  • onmouseover : It is used for Java Script code to be invoked when the pointing device is moved into this element. 
  • onmousemove : It is used for Java Script code to be invoked when the pointing device is moved while it is in this element. 
  • onmouseout : It is used for Java Script code to be invoked when the pointing device is moves out of this element. 
  • onkeypress : It is used for Java Script code to be invoked when a key is pressed over this element. 
  • onfocus : It is used to set the java script code to execute when element receives the  focus.
  • onkeydown : It is used for Java Script code to be invoked when a key is pressed down over this element. 
  • onkeyup : It is used for Java Script code to be invoked when a key is released over this element. 
  • onselect : It is used to set the java script code to execute when text of the component is selected by the user.
  • readonly : Its a boolean attribute. It is used to indicate the user that its value can't be modified, if it is set to true. 
  • required : Its a boolean attribute. It indicates that its value is required by the user before the submission of the form to the server. If it is set to true and value is not provided then an error message comes.
  • tabindex : This is a standard html attribute. It is used to set the order of receiving the focus on the movement of TAB key by the user. 
  • validator : It takes the method binding expression. This expression represents the validator method. This method is called at the time of validation of the component. 
  • value : This is to set the current value of the component. 
  • valueChangeListener : This also takes a method binding expression. This expression represents value change listener method. This method will be called when new value is set for this component.
Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: May 31, 2007

Related Tutorials

Discuss: JSF inputText tag   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com