public abstract class AbstractFormComponent extends AbstractComponent implements IFormComponent
Form
component.Constructor and Description |
---|
AbstractFormComponent() |
Modifier and Type | Method and Description |
---|---|
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. |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClientId, getDisplayName, isDisabled
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
public AbstractFormComponent()
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 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)
public boolean isRequired()
isRequired
in interface IFormComponent
protected abstract void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
protected abstract void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)