org.apache.tapestry.wml
Class AbstractPostfield

java.lang.Object
  extended by org.apache.tapestry.spec.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.form.AbstractFormComponent
              extended by org.apache.tapestry.wml.AbstractPostfield
All Implemented Interfaces:
IFormComponent, IComponent, ILocatable, ILocationHolder, IRender
Direct Known Subclasses:
Postfield, SelectionField

public abstract class AbstractPostfield
extends AbstractFormComponent

A base class for building components that correspond to WML postfield elements. All such components must be wrapped (directly or indirectly) by a Go component.

Since:
3.0
Version:
$Id: AbstractPostfield.java 243791 2004-02-19 17:38:13Z hlship $
Author:
David Solis

Constructor Summary
AbstractPostfield()
           
 
Method Summary
abstract  IForm getForm()
          Returns the IForm which contains the component, or null if the component is not contained by a form, of if the containing Form is not currently renderring.
 IForm getForm(IRequestCycle cycle)
          Returns the Go wrapping this component.
abstract  String getName()
          Returns the name of the component, which is automatically generated during renderring.
abstract  IBinding getValueBinding()
           
abstract  String getVarName()
           
 boolean isDisabled()
          Returns true if the component is disabled.
protected  void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
          Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle) to actually render the component (with any parameter values already set).
protected abstract  void rewind(IRequestCycle cycle)
           
abstract  void setForm(IForm form)
           
abstract  void setName(String name)
          Invoked by IForm.getElementId(IFormComponent) when a name is created for a form component.
 void updateValue(Object value)
           
 
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent
getDisplayName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, cleanupAfterRender, finishLoad, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, format, format, format, format, formatString, formatString, formatString, formatString, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification, toString
 
Methods inherited from class org.apache.tapestry.spec.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Constructor Detail

AbstractPostfield

public AbstractPostfield()
Method Detail

getForm

public IForm getForm(IRequestCycle cycle)
Returns the Go wrapping this component.

Overrides:
getForm in class AbstractFormComponent
Throws:
ApplicationRuntimeException - if the component is not wrapped by a Go.

renderComponent

protected void renderComponent(IMarkupWriter writer,
                               IRequestCycle cycle)
Description copied from class: AbstractComponent
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle) to actually render the component (with any parameter values already set). This is the method that subclasses must implement.

Specified by:
renderComponent in class AbstractComponent
See Also:
AbstractComponent.renderComponent(IMarkupWriter, IRequestCycle)

rewind

protected abstract void rewind(IRequestCycle cycle)

isDisabled

public boolean isDisabled()
Description copied from interface: IFormComponent
Returns true if the component is disabled. This is important when the containing form is submitted, since disabled parameters do not update their bindings.


getVarName

public abstract String getVarName()

getValueBinding

public abstract IBinding getValueBinding()

updateValue

public void updateValue(Object value)

getForm

public abstract IForm getForm()
Description copied from interface: IFormComponent
Returns the IForm which contains the component, or null if the component is not contained by a form, of if the containing Form is not currently renderring.

Specified by:
getForm in interface IFormComponent
Specified by:
getForm in class AbstractFormComponent

setForm

public abstract void setForm(IForm form)
Specified by:
setForm in class AbstractFormComponent

getName

public abstract 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.

Specified by:
getName in interface IFormComponent
Specified by:
getName in class AbstractFormComponent

setName

public abstract void setName(String name)
Description copied from interface: IFormComponent
Invoked by IForm.getElementId(IFormComponent) when a name is created for a form component.

Specified by:
setName in interface IFormComponent
Specified by:
setName in class AbstractFormComponent