org.apache.tapestry.form
Interface IFormComponent

All Superinterfaces:
IComponent, IRender, org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder
All Known Implementing Classes:
AbstractFormComponent, ValidField

public interface IFormComponent
extends IComponent

A common interface implemented by all form components (components that create interactive elements in the rendered page).

Author:
Howard Lewis Ship

Method Summary
 java.lang.String getDisplayName()
          May be implemented to return a user-presentable, localized name for the component, which is used in labels or error messages.
 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.
 java.lang.String getName()
          Returns the name of the component, which is automatically generated during renderring.
 boolean isDisabled()
          Returns true if the component is disabled.
 void setName(java.lang.String name)
          Invoked by FormBehavior.getElementId(IFormComponent) when a name is created for a form component.
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Method Detail

getForm

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


getName

public java.lang.String getName()
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.


setName

public void setName(java.lang.String name)
Invoked by FormBehavior.getElementId(IFormComponent) when a name is created for a form component.

Since:
3.0

getDisplayName

public java.lang.String getDisplayName()
May be implemented to return a user-presentable, localized name for the component, which is used in labels or error messages. Most components simply return null.

Since:
1.0.9

isDisabled

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

Since:
2.2