JSF - h:inputTextarea

The h:inputText tag renders an HTML input element of the type "text".
<h:inputTextarea row = "10" col = "10" value = "Hello World!   
   Everything is fine!" readonly = "true"/>
<textarea name = "j_idt18:j_idt20" readonly = "readonly"> 
   Hello World! Everything is fine!</textarea> 

id
Identifier for a component
binding
Reference to the component that can be used in a backing bean
rendered
A boolean; false suppresses rendering
styleClass
Cascading stylesheet (CSS) class name
value
A component’s value, typically a value binding
valueChangeListener
A method binding to a method that responds to value changes
converter
Converter class name
validator
Class name of a validator that’s created and attached to a component
required
A boolean; if true, requires a value to be entered in the associated field
accesskey
A key, typically combined with a system-defined metakey, that gives focus to an element
accept
Comma-separated list of content types for a form
accept-charset
Comma- or space-separated list of character encodings for a form. The accept-charset attribute is specified with the JSF HTML attribute named acceptcharset.
cols
Number of columns
border
Pixel value for an element’s border width
charset
Character encoding for a linked resource
coords
Coordinates for an element whose shape is a rectangle, circle, or polygon
dir
Direction for text. Valid values are ltr (left to right) and rtl (right to left).
disabled
Disabled state of an input element or button
hreflang
Base language of a resource specified with the href attribute; hreflang may only be used with href.
lang
Base language of an element’s attributes and text
rows
Number of rows
readonly
Read-only state of an input field; the text can be selected in a readonly field but not edited
style
Inline style information
tabindex
Numerical value specifying a tab index
target
The name of a frame in which a document is opened
title
A title, used for accessibility, that describes an element. Visual browsers typically create tooltips for the title’s value
type
Type of a link; for example, stylesheet
width
Width of an element
onblur
Element loses focus
onchange
Element’s value changes
onclick
Mouse button is clicked over the element
ondblclick
Mouse button is double-clicked over the element
onfocus
Element receives focus
onkeydown
Key is pressed
onkeypress
Key is pressed and subsequently released
onkeyup
Key is released
onmousedown
Mouse button is pressed over the element
onmousemove
Mouse moves over the element
onmouseout
Mouse leaves the element’s area
onmouseover
Mouse moves onto an element
onmouseup
Mouse button is released
onreset
Form is reset
onselect
Text is selected in an input field
immediate
Process validation early in the life cycle
Let us create a test JSF application to test the above tag.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns = "http://www.w3.org/1999/xhtml">
   <head>
      <title>JSF Tutorial!</title>
   </head>
   
   <body>
      <h2>h:inputTextArea example</h2>
      <hr />
      
      <h:form>
         <h3>Read-Only input text area</h3>
         <h:inputTextarea row = "10" col = "10" value = "Hello World! 
            <br/> Everything is fine!" readonly = "true"/>
         <h3>Normal input text area</h3>
         <h:inputTextarea value = "Hello World! <br/> Everything is fine!"/>
      </h:form> 
   
   </body>
</html>
Once you are ready with all the changes done, let us compile and run the application as we did in JSF - First Application chapter. If everything is fine with your application, this will produce the following result.

    37 Lectures 
     3.5 hours 

 Chaand Sheikh
 Print
 Add Notes
 Bookmark this page