|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FormBehavior
Common interface extended by IForm
and
FormSupport
.
Method Summary | |
---|---|
void |
addDeferredRunnable(java.lang.Runnable runnable)
Adds a deferred runnable, an object to be executed either before the </form> tag is rendered (when rendering), or before the form's listener is invoked (when rewinding). |
void |
addEventHandler(FormEventType type,
java.lang.String functionName)
Deprecated. Wiring of form event handlers is now managed on the client side. This method may be removed in a future release of Tapestry. |
void |
addHiddenValue(java.lang.String name,
java.lang.String value)
Adds a hidden field value to be stored in the form. |
void |
addHiddenValue(java.lang.String name,
java.lang.String id,
java.lang.String value)
Adds a hidden field value to be stored in the form. |
java.lang.String |
getElementId(IFormComponent component)
Constructs a unique identifier (within the Form). |
java.lang.String |
getElementId(IFormComponent component,
java.lang.String baseId)
Constructs a unique identifier from the base id. |
boolean |
isRewinding()
Returns true if the form is rewinding (meaning, the form was the subject of the request cycle). |
void |
prerenderField(IMarkupWriter writer,
IComponent field,
org.apache.hivemind.Location location)
Pre-renders the specified field, buffering the result for later use by wasPrerendered(IMarkupWriter, IComponent) . |
void |
registerForFocus(IFormComponent field,
int priority)
Registers a field for automatic focus. |
void |
setEncodingType(java.lang.String encodingType)
May be invoked by a component to force the encoding type of the form to a particular value. |
boolean |
wasPrerendered(IMarkupWriter writer,
IComponent field)
Invoked by a form control component (a field) that may have been pre-rendered. |
Method Detail |
---|
void addEventHandler(FormEventType type, java.lang.String functionName)
FormEventType.SUBMIT
is most typical.
void addHiddenValue(java.lang.String name, java.lang.String value)
It is acceptible to add multiple hidden fields with the same name. They will be written in the order they are received.
void addHiddenValue(java.lang.String name, java.lang.String id, java.lang.String value)
It is acceptible to add multiple hidden fields with the same name. They will be written in the order they are received.
java.lang.String getElementId(IFormComponent component)
Simply invokes getElementId(IFormComponent, String)
with the component's id.
Note: yes, some confusion on naming here. This is the form element id, which should be (for
Tapestry purposes) unique within the rendered form. The IFormComponent.getClientId()
is different, and should be unique within the rendered page.
java.lang.String getElementId(IFormComponent component, java.lang.String baseId)
This method is provided simply so that some components (
ImageSubmit
) have more specific control over their names.
Invokes IFormComponent.setName(String)
with the result, as well as returning it.
StaleLinkException
- if, when the form itself is rewinding, the element id allocated does not match
the expected id (as allocated when the form rendered). This indicates that the
state of the application has changed between the time the form renderred and the
time it was submitted.boolean isRewinding()
void setEncodingType(java.lang.String encodingType)
ApplicationRuntimeException
- if the current encoding type is not null and doesn't match the provided encoding
typeUpload
void prerenderField(IMarkupWriter writer, IComponent field, org.apache.hivemind.Location location)
wasPrerendered(IMarkupWriter, IComponent)
. Typically, it is a
FieldLabel
component that pre-renders an associated
field. This little dance is necessary to properly support field labels inside loops, and to
handle the portlet action/render request cycle.
writer
- the markup writer (from which a nested markup writer is obtained)field
- the field to pre-render. The field is responsible for invoking
wasPrerendered(IMarkupWriter, IComponent)
.location
- an optional location (of the FieldLabel component) used when reporting errors.boolean wasPrerendered(IMarkupWriter writer, IComponent field)
void addDeferredRunnable(java.lang.Runnable runnable)
runnable
- the object to execute (which may not be null)void registerForFocus(IFormComponent field, int priority)
field
- the field requesting focuspriority
- a priority level used to determine whether the registered field becomes the focus
field. Constants for this purpose are defined in ValidationConstants
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |