115
PrimeFaces InputText
It is an extension to the standard inputText with skinning capabilities. We can create it by using the <p:inputText> component. It is used to get user input in JSF application. It includes various attributes that are tabled below.
InputText attributes
Attribute | Default value | Return type | Description |
---|---|---|---|
id | null | String | It is an unique identifier of the component. |
rendered | true | Boolean | It is used to specify the rendering of the component. |
value | null | Object | It is used to set value of the component. |
required | false | Boolean | It is used to make component as required. |
accesskey | null | String | It is used to set access key for the component. |
alt | null | String | It is used to set alternate textual description of the input field. |
autocomplete | null | String | It is used to set autocomplete behavior. |
dir | null | String | It is a direction indication for text. |
lang | null | String | It is used to set language of the component. |
maxlength | null | Integer | It is used to set maximum number of characters that may be entered in this field. |
placeholder | null | String | It is used to specify a short hint. |
readonly | 0 | Boolean | It is used to set this component readonly. |
size | null | Integer | It is used to set size of the component. |
style | null | String | It is used to set inline CSS of the component. |
title | null | String | It provides advisory tooltip. |
type | text | String | It is used to set type of input. |
Example
Here, in the following example, we are implementing <p:inpuText> component. This example contains the following files.
JSF File
// inputText.xhtml
This JSF Page produces the following output.
Output:
Next TopicPrimeFaces InputMask