|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IFormComponent
A common interface implemented by all form components (components that create interactive elements in the rendered page).
Method Summary | |
---|---|
String |
getClientId()
Returns the component's client-side element id. |
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, or if the containing Form is not currently rendering. |
String |
getName()
Returns the name of the component, which is automatically generated during renderring. |
boolean |
isDisabled()
Returns true if the component is disabled. |
boolean |
isRequired()
Returns true if the field is required. |
void |
setName(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, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName |
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 |
---|
IForm getForm()
IForm
which contains the component, or null if the
component is not contained by a form, or if the containing Form is not currently rendering.
String getName()
This value is set inside the component's render method and is not cleared. If the
component is inside a ForBean
, 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.
void setName(String name)
FormBehavior.getElementId(IFormComponent)
when a name is created for a form
component.
FormBehavior.getElementId(IFormComponent)
String getDisplayName()
boolean isDisabled()
String getClientId()
IRequestCycle.getUniqueId(String)
to ensure that it is unique.
The component is expected to write an id attribute (if it has a non null id). As with
getName()
, if a component renders more than once (such as inside a loop) then on
each render it will have a different clientId.
Note:Though semantically this method should result in the roughly the same results,
the method used to create unique client ID's on form components is not the same as that
defined in IComponent
.
getClientId
in interface IComponent
boolean isRequired()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |