|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry.spec.BaseLocatable org.apache.tapestry.AbstractComponent org.apache.tapestry.form.AbstractFormComponent
public abstract class AbstractFormComponent
A base class for building components that correspond to HTML form elements.
All such components must be wrapped (directly or indirectly) by
a Form
component.
Constructor Summary | |
---|---|
AbstractFormComponent()
|
Method Summary | |
---|---|
String |
getDisplayName()
Implemented in some subclasses to provide a display name (suitable for presentation to the user as a label or error message). |
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 Form wrapping this component. |
abstract String |
getName()
Returns the name of the component, which is automatically generated during renderring. |
abstract void |
setForm(IForm form)
|
abstract void |
setName(String name)
Invoked by IForm.getElementId(IFormComponent) when a name is created
for a form component. |
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.form.IFormComponent |
---|
isDisabled |
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 |
---|
public AbstractFormComponent()
Method Detail |
---|
public IForm getForm(IRequestCycle cycle)
Form
wrapping this component. Invokes
setForm(IForm)
(so that the component may know, later, what the
form is). Also, if the form has a delegate,
then IValidationDelegate.setFormComponent(IFormComponent)
is invoked.
ApplicationRuntimeException
- if the component is not wrapped by a Form
.public abstract IForm getForm()
IFormComponent
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.
getForm
in interface IFormComponent
public abstract void setForm(IForm form)
public abstract String getName()
IFormComponent
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.
getName
in interface IFormComponent
public abstract void setName(String name)
IFormComponent
IForm.getElementId(IFormComponent)
when a name is created
for a form component.
setName
in interface IFormComponent
public String getDisplayName()
getDisplayName
in interface IFormComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |