Use the ui:passwordField tag to create an input
field where the characters entered are echoed back with a
replacement character, so as to mask the input.
HTML Elements and Layout
The textField component renders an XHTML <input
type="password"> element.
Configuring the ui:passwordField Tag
Use the password attribute to associate
the component with a model object that represents the current value,
by setting the attribute's value to an EL expression that corresponds
to a property of a managed bean.
To optionally specify a label for the component, use the
label attribute, or specify a label facet.
Facets
label : use this facet to specify a custom
component for the label.
readOnly : use this facet to specify a custom
component for displaying the value of this component when it is
marked as readonly. The default is a ui:staticText .
Theme Identifiers
The input element has a style class "TxtFld", or "TxtFldDis"
when the field is disabled. If a label attribute is specified, the
label element's class attribute is set to "LblLvl1Txt", "LblLvl2Txt" or
"LblLvl3Txt" depending on the label level.
Client-side JavaScript functions
In all the functions below, <id> should be
the generated id of the PasswordField component.
field_setDisabled(<id>, <disabled>)
|
Enable/disable the field. Set <disabled>
to true to disable the component, or false to enable it.
|
field_setValue(<id>, <newValue>)
|
Set the value of the field to <newValue> .
|
field_getValue(<id>)
|
Get the value of the field. |
field_getInputElement(<id>) |
Get hold of a reference to the input element rendered by this
component.
|
component_setVisible(<id>)
|
Hide or show this component.
|
Example
This example uses a backing bean User with a
property password . The tag generates a label followed by
text input field. The required attribute is set to true, which causes
an icon to be rendered next to the label to indicate that the
application user must enter a value in the text field. The icon, label
and input elements are enclosed by a span.
<ui:passwordField id="password"
password="#{User.password}"
label="Password:"
required="true"/>
Auto-generated component class.
Do NOT modify; all changes
will be lost!
|