InputText |
||||||||||||||||||||
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 FeaturesBasic ConfigurationThe InputText component can be added to a page using the <o:inputText> tag. This tag is just an extended version of the standard <h:inputText> tag. Therefore, you can safely replace the standard InputText components with OpenFaces InputText components which gives you an additional functionality. Just like in the standard <h:inputText> the value attribute lets you specify the current value of the component. The following example shows a definition of the InputText with the value attribute. <o:inputText value="#{InputTextBean.email}" />
<o:inputText value="#{InputTextBean.email}" promptText="E-mail address"/> And here is the result: You can also specify a custom style for the prompt text as described below. Customizing StylesYou can apply styles for the InputText 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 InputText component:
<o:inputText id="styledInputText" style="background: beige; border: 2px solid brown; color: brown; font-weight: bold;" promptText="E-mail address" promptTextStyle="font-style: italic; color: #7e7e7e;" focusedStyle="border: 2px solid orange;"/> And here is the result: Server-Side Event ListenersGiven that the InputText 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 HTMLInputText component. You can also add a value change listener to the component by using the <f:valueChangeListener> tag. Client-Side EventsThe InputText 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. | ![]() |