Hidden

Adds a hidden HTML <input type="hidden"> field to a Form . This is often used to synchronize data when the form is submitted with values known when the page was rendered.

See also: Form

Parameters

Name Type Required Default Description
value Object yes The value to be stored in the the hidden field. The parameter is read when the HTML response is generated, and then written when the form is submitted. A DataSqueezer is used to convert the value between an arbitrary type and a String.
id Object no undefined in HTML presentation. ID parameter of HTML hidden object. The parameter is read when the HTML response is generated and if there is a specific value the component generate parameter id with passed value in its HTML presentation.
listener IActionListener no

A listener that is informed after the value parameter is updated. This allows the data set operated on by the rest of the Form components to be synchronized to the value stored in the hidden field.

A typical use is to encode the primary key of an entity as a Hidden; when the form is submitted, the Hidden's listener re-reads the corresponding entity from the database.

encode boolean no true

If true (the default) a DataSqueezer is used to transform the value Object into the HTML value string, and (on submit) to convert the string back into an Object.

If false, then the value must be a String. This is most likely used when the hidden field is used to communicate with client-side logic in JavaScript (which is not able to interpret even Strings encoded by DataSqueezer ). If you find yourself getting strange errors during the form rewind it could easily be Tapestry trying to interpret a value you've set via JavaScript.

Body: removed

Informal parameters: forbidden

Reserved parameters: name