com.primix.tapestry.form
Class Hidden

java.lang.Object
  |
  +--com.primix.tapestry.AbstractComponent
        |
        +--com.primix.tapestry.form.AbstractFormComponent
              |
              +--com.primix.tapestry.form.Hidden
All Implemented Interfaces:
IComponent, IFormComponent, IRender

public class Hidden
extends AbstractFormComponent

Implements a hidden field within a Form.
Parameter Type Read / Write Required Default Description
value java.lang.String R / W 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.
listener IActionListener R 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.

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.

Does not allow informal parameters, and may not contain a body.

Version:
$Id: Hidden.java,v 1.8 2001/08/28 20:33:41 hship Exp $
Author:
Howard Ship

Fields inherited from class com.primix.tapestry.AbstractComponent
id, page, specification, wrapped, wrappedCount
 
Constructor Summary
Hidden()
           
 
Method Summary
 IBinding getListenerBinding()
           
 java.lang.String getName()
          Returns the name of the component, which is automatically generated during renderring.
 IBinding getValueBinding()
           
 void render(IResponseWriter writer, IRequestCycle cycle)
          The principal rendering/rewinding method.
 void setListenerBinding(IBinding value)
           
 void setValueBinding(IBinding value)
           
 
Methods inherited from class com.primix.tapestry.form.AbstractFormComponent
getForm, getForm
 
Methods inherited from class com.primix.tapestry.AbstractComponent
addAsset, addComponent, addWrapped, cleanupAfterRender, cleanupComponent, finishLoad, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getPage, getSpecification, prepareForRender, renderWrapped, reset, setBinding, setContainer, setId, setPage, setSpecification, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.primix.tapestry.IComponent
addAsset, addComponent, addWrapped, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getPage, getSpecification, renderWrapped, setBinding, setContainer, setId, setPage, setSpecification
 

Constructor Detail

Hidden

public Hidden()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: IFormComponent
Returns the name of the component, which is automatically generated during renderring.

This value is set inside the component's render method and is not cleared. If the component is inside a Foreach, the value returned is the most recent name generated for the component.

This property is made available to facilitate writing JavaScript that allows components (in the client web browser) to interact.

In practice, a Script component works with the Body component to get the JavaScript code inserted and referenced.

Overrides:
getName in class AbstractFormComponent

getValueBinding

public IBinding getValueBinding()

setValueBinding

public void setValueBinding(IBinding value)

getListenerBinding

public IBinding getListenerBinding()

setListenerBinding

public void setListenerBinding(IBinding value)

render

public void render(IResponseWriter writer,
                   IRequestCycle cycle)
            throws RequestCycleException
Description copied from interface: IRender
The principal rendering/rewinding method. This will cause the receiving component to render its top level elements (HTML text and components).

Renderring and rewinding are the exact same process. The same code that renders must be able to restore state by going through the exact same operations (even though the output is discarded).