com.sun.rave.web.ui.component
Class PasswordFieldBase

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIOutput
              extended byjavax.faces.component.UIInput
                  extended bycom.sun.rave.web.ui.component.HiddenFieldBase
                      extended bycom.sun.rave.web.ui.component.HiddenField
                          extended bycom.sun.rave.web.ui.component.FieldBase
                              extended bycom.sun.rave.web.ui.component.Field
                                  extended bycom.sun.rave.web.ui.component.PasswordFieldBase
All Implemented Interfaces:
ComplexComponent, javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
PasswordField

public abstract class PasswordFieldBase
extends Field

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

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!


Field Summary
 
Fields inherited from class com.sun.rave.web.ui.component.Field
INPUT_ID, LABEL_FACET, LABEL_ID, READONLY_FACET, READONLY_ID
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Constructor Summary
PasswordFieldBase()
          Construct a new PasswordFieldBase.
 
Method Summary
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.Object getPassword()
          Literal value to be rendered in this input field.
 javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
          Return the ValueBinding stored for the specified name (if any), respecting any property aliases.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setPassword(java.lang.Object password)
          Literal value to be rendered in this input field.
 void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
          Set the ValueBinding stored for the specified name (if any), respecting any property aliases.
 
Methods inherited from class com.sun.rave.web.ui.component.Field
getColumns, getLabelComponent, getPrimaryElementID, getReadOnlyComponent, log, setText
 
Methods inherited from class com.sun.rave.web.ui.component.FieldBase
getLabel, getLabelLevel, getMaxLength, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getStyle, getStyleClass, getTabIndex, getText, getToolTip, isDisabled, isReadOnly, isTrim, isVisible, setColumns, setDisabled, setLabel, setLabelLevel, setMaxLength, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setStyle, setStyleClass, setTabIndex, setToolTip, setTrim, setVisible
 
Methods inherited from class com.sun.rave.web.ui.component.HiddenField
getConvertedValue, getReadOnlyValueString, getValueAsString
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, compareValues, decode, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter
 

Constructor Detail

PasswordFieldBase

public PasswordFieldBase()

Construct a new PasswordFieldBase.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class FieldBase

getValueBinding

public javax.faces.el.ValueBinding getValueBinding(java.lang.String name)

Return the ValueBinding stored for the specified name (if any), respecting any property aliases.

Overrides:
getValueBinding in class FieldBase
Parameters:
name - Name of value binding to retrieve

setValueBinding

public void setValueBinding(java.lang.String name,
                            javax.faces.el.ValueBinding binding)

Set the ValueBinding stored for the specified name (if any), respecting any property aliases.

Overrides:
setValueBinding in class FieldBase
Parameters:
name - Name of value binding to set
binding - ValueBinding to set, or null to remove

getPassword

public java.lang.Object getPassword()

Literal value to be rendered in this input field. If this property is specified by a value binding expression, the corresponding value will be updated if validation succeeds.


setPassword

public void setPassword(java.lang.Object password)

Literal value to be rendered in this input field. If this property is specified by a value binding expression, the corresponding value will be updated if validation succeeds.

See Also:
getPassword()

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class FieldBase

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class FieldBase