org.apache.tapestry.form
Interface IFormComponent

All Superinterfaces:
IComponent, ILocatable, ILocationHolder, IRender
All Known Implementing Classes:
AbstractFormComponent, AbstractPostfield, AbstractTextField, Button, Checkbox, DateField, DatePicker, FormConditional, Hidden, ImageSubmit, LinkSubmit, ListEdit, MultiplePropertySelection, NumericField, Palette, Postfield, PropertySelection, RadioGroup, Select, SelectionField, Submit, TextArea, TextField, Upload, ValidatingTextField, ValidField

public interface IFormComponent
extends IComponent

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

Version:
$Id: IFormComponent.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Method Summary
 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.
 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(String name)
          Invoked by IForm.getElementId(IFormComponent) when a name is created for a form component.
 
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
 

Method Detail

getForm

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

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

void setName(String name)
Invoked by IForm.getElementId(IFormComponent) when a name is created for a form component.

Since:
3.0

getDisplayName

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

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