InputTextarea |
||||||||||||||||||||
Developer’s Guide Home
Installation and Configuration Common Concepts Components Index Border Layout Panel Calendar Chart Command Button Command Link Composite Filter Confirmation Data Table Date Chooser Day Table Drop Down Field Dynamic Image Folding Panel For Each Graphic Text Hint Label Input Text Input Textarea Layered Pane Level Indicator Popup Layer Popup Menu Select Boolean Checkbox Select Many Checkbox Select One Radio Spinner Suggestion Field Tabbed Pane Tab Set Tree Table Two List Selection Window Focus Load Bundle Scroll Position Ajax Framework Validation Framework Tag Reference API Reference |
Key Features
Basic ConfigurationThe InputTextarea component can be added to a page using the <o:inputTextarea> tag. This tag is just an extended version of the standard <h:inputTextarea> tag. Therefore, you can safely replace the standard InputTextarea components with OpenFaces InputTextarea components which gives you an additional functionality. Just like in the standard <h:inputTextarea> the value attribute lets you specify the current value of the component. The following example shows a definition of the InputTextarea with the value attribute. <o:inputTextarea value="#{InputTextareaBean.email}" />
<o:inputTextarea value="#{InputTextBean.email}" promptText="E-mail address"/> Once you focus this component, the prompt text disappears for you to enter the text. If you leave the text field without entering the text, the prompt will be displayed again. You can also specify a custom style for the prompt text as described below. InputTextarea can be configured to automatically increase its height when the typed content exceeds its size.This feature can be used to create compact page layouts and allow comfortable input of an arbitrary amount of text at the same time. To turn on this feature just set autoGrowing attribute to "true" (it has a value of "false" by default). Customizing StylesYou can apply styles for the InputTextarea component when it's in a normal, focused or rollover state. The table below lists all style attributes:
The following example demonstrates the usage of style-related attributes of the InputTextarea component:
<o:inputTextarea id="styledInputTextarea" style="background: beige; border: 2px solid pink; width: 160px; color: brown; font-weight: bold;" promptText="E-mail address" promptTextStyle="background: none; font-style: italic; font-weight: lighter; color:#7e7e7e;" focusedStyle="border: 1px solid green;"/> Server-Side Event ListenersGiven that the InputTextarea component is a UIInput component, it can fire javax.faces.event.ValueChangeEvent just like any other UIInput component does. To handle a value change event on the server side, the valueChangeListener attribute should be used in the same way as for the HTMLInputTextarea component. You can also add a value change listener to the component by using the <f:valueChangeListener> tag. Client-Side EventsThe InputTextarea component supports a set of standard client-side events such as onclick, ondblclick, onmousedown, onmouseover, onmouseup, onmouseout, onmousemove, onselect, onchange, onfocus, onblur, onkeyup, onkeydown, onkeypress. Client-Side APIAll client-side API methods for the InputText component are listed in the following table:
|
|||||||||||||||||||
© 2010 TeamDev Ltd. | ![]() |