|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hivemind.impl.BaseLocatable
org.apache.tapestry.AbstractComponent
org.apache.tapestry.form.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 | |
protected boolean |
getAlwaysRenderBodyOnRewind()
A small number of components should always render their body on rewind (even if the component is itself disabled) and should override this method to return true. |
protected boolean |
getCanTakeFocus()
Returns true if the corresponding field, on the client side, can accept user focus (i.e., implements the focus() method). |
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. |
abstract java.lang.String |
getIdParameter()
Should be connected to a parameter named "id" (annotations would be helpful here!). |
abstract java.lang.String |
getName()
Returns the name of the component, which is automatically generated during renderring. |
boolean |
isRequired()
Returns false. |
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 void |
renderDelegateAttributes(IMarkupWriter writer,
IRequestCycle cycle)
|
protected void |
renderDelegatePrefix(IMarkupWriter writer,
IRequestCycle cycle)
|
protected void |
renderDelegateSuffix(IMarkupWriter writer,
IRequestCycle cycle)
|
protected abstract void |
renderFormComponent(IMarkupWriter writer,
IRequestCycle cycle)
|
protected void |
renderIdAttribute(IMarkupWriter writer,
IRequestCycle cycle)
Invoked from renderFormComponent(IMarkupWriter, IRequestCycle) (that is, an
implementation in a subclass), to obtain an id and render an id attribute. |
protected abstract void |
rewindFormComponent(IMarkupWriter writer,
IRequestCycle cycle)
|
abstract void |
setClientId(java.lang.String id)
Stores the actual id allocated (or null if the component doesn't support this). |
abstract void |
setForm(IForm form)
|
protected void |
setName(IForm form)
|
abstract void |
setName(java.lang.String name)
Invoked by FormBehavior.getElementId(IFormComponent) when a name is created for a form
component. |
Methods inherited from class org.apache.tapestry.AbstractComponent |
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString |
Methods inherited from class org.apache.hivemind.impl.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 |
getClientId, getDisplayName, isDisabled |
Methods inherited from interface org.apache.tapestry.IComponent |
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, 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 |
Constructor Detail |
public AbstractFormComponent()
Method Detail |
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 java.lang.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(java.lang.String name)
IFormComponent
FormBehavior.getElementId(IFormComponent)
when a name is created for a form
component.
setName
in interface IFormComponent
FormBehavior.getElementId(IFormComponent)
protected boolean getCanTakeFocus()
Hidden
)
override this method to always return false.
public abstract java.lang.String getIdParameter()
public abstract void setClientId(java.lang.String id)
protected void renderIdAttribute(IMarkupWriter writer, IRequestCycle cycle)
renderFormComponent(IMarkupWriter, IRequestCycle)
(that is, an
implementation in a subclass), to obtain an id and render an id attribute. Reads
getIdParameter()
.
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
AbstractComponent
AbstractComponent.render(IMarkupWriter, IRequestCycle)
to actually render the component
(with any parameter values already set). This is the method that subclasses must implement.
renderComponent
in class AbstractComponent
AbstractComponent.renderComponent(org.apache.tapestry.IMarkupWriter,
org.apache.tapestry.IRequestCycle)
protected boolean getAlwaysRenderBodyOnRewind()
rewindFormComponent(IMarkupWriter, IRequestCycle)
should leave this method returning
false. Remember that if the component is disabled
then
rewindFormComponent(IMarkupWriter, IRequestCycle)
won't be invoked.
protected void renderDelegatePrefix(IMarkupWriter writer, IRequestCycle cycle)
protected void renderDelegateAttributes(IMarkupWriter writer, IRequestCycle cycle)
protected void renderDelegateSuffix(IMarkupWriter writer, IRequestCycle cycle)
protected void setName(IForm form)
public boolean isRequired()
isRequired
in interface IFormComponent
protected abstract void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
protected abstract void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |