You can drag the Hidden Field component from
the Palette's Basic category to the Visual Designer to create a hidden text field.
A hidden field is a form field that is not visible, but can
be used to pass data to the server as well as to hold data that can be interpreted by Javascript on the page. A typical use of a
hidden field is to store session data in the page as an alternative to using the Session bean to store the data. For example, you might use a hidden field to pass the primary key of the current
row back to the same page, instead of saving and restoring it in session scope.
A Hidden Field component is equivalent to the HTML tag <input
type='hidden'>
. The value of the field is the
data the field stores and passes back to the server when the
form is submitted.
Since the field is hidden, the component does not appear on the page, but it does appear in the Navigator window. You can select the hidden field in the Navigator window and right-click it to open its pop-up menu.
After adding a hidden field to a Visual Web JSF page, you can do a number of things with it:
id
attribute. In the page bean, this property's value is
the name of the HiddenField
object.processValueChange
method so you can insert code that executes when the
value of this component changes. For example, the
user changes the value of another component that is
controlling the value of this component.value
property to a data provider or an object so you can evaluate the component's value when the page is submitted. For more information, see Bind to Data Dialog Box.value
property to other objects
or properties that supply data for the values of this
component's properties.