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

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
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
HiddenField

public abstract class HiddenFieldBase
extends javax.faces.component.UIInput

Use the ui:hiddenField tag to create a hidden field, which is present in the HTML, but not displayed to the user. Hidden fields are useful for saving state information.

HTML Elements and Layout

The hiddenField component renders an XHTML <input type="hidden"> element.

Configuring the ui:hiddenField Tag

Use the value attribute to associate the component with a model object that represents the current value, by setting the attribute's value to a JavaServer Faces EL expression that corresponds to a property of a backing bean.

Facets

This component has no facets.

Theme Identifiers

This component does not use any style classes from the theme.

Client-side JavaScript functions

In all the functions below, <id> should be the generated id of the HiddenField 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.

Examples

This example uses a backing bean FieldTest with a property counter. The property is an int but it is not necessary to specify a converter since the default JavaServer Faces converter will be used. The value of the hidden field may be updated through a JavaScript. The tag generates an HTML input element.

 <ui:hiddenField id="counter" value="#{FieldTest.counter}"/>
 

Auto-generated component class. Do NOT modify; all changes will be lost!


Field Summary
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Constructor Summary
HiddenFieldBase()
          Construct a new HiddenFieldBase.
 
Method Summary
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.Object getText()
          Literal value to be rendered in this hidden field.
 javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
          Return the ValueBinding stored for the specified name (if any), respecting any property aliases.
 boolean isDisabled()
          Flag indicating that the hidden field should not send its value to the server.
 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 setDisabled(boolean disabled)
          Flag indicating that the hidden field should not send its value to the server.
 void setText(java.lang.Object text)
          Literal value to be rendered in this hidden 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 javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, compareValues, decode, getConvertedValue, 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

HiddenFieldBase

public HiddenFieldBase()

Construct a new HiddenFieldBase.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.


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.

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.

Parameters:
name - Name of value binding to set
binding - ValueBinding to set, or null to remove

isDisabled

public boolean isDisabled()

Flag indicating that the hidden field should not send its value to the server.


setDisabled

public void setDisabled(boolean disabled)

Flag indicating that the hidden field should not send its value to the server.

See Also:
isDisabled()

getText

public java.lang.Object getText()

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


setText

public void setText(java.lang.Object text)

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

See Also:
getText()

restoreState

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

Restore the state of this component.


saveState

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

Save the state of this component.