public interface IFormComponent extends IComponent
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClientId()
Returns the component's client-side element id.
|
java.lang.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. |
java.lang.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(java.lang.String name)
Invoked by
FormBehavior.getElementId(IFormComponent) when a name is created for a form
component. |
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
IForm getForm()
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.java.lang.String getName()
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.
void setName(java.lang.String name)
FormBehavior.getElementId(IFormComponent)
when a name is created for a form
component.FormBehavior.getElementId(IFormComponent)
java.lang.String getDisplayName()
boolean isDisabled()
java.lang.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.boolean isRequired()