|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.form.FormSupportImpl
Encapsulates most of the behavior of a Form component.
Field Summary | |
static java.lang.String |
FORM_IDS
Name of query parameter storing the ids alloocated while rendering the form, as a comma seperated list. |
static java.lang.String |
RESERVED_FORM_IDS
Names of additional ids that were pre-reserved, as a comma-sepereated list. |
Constructor Summary | |
FormSupportImpl(IMarkupWriter writer,
IRequestCycle cycle,
IForm form)
|
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)
Adds an event handler for the form, of the given type. |
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 (within the Form). |
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 |
render(java.lang.String method,
IRender informalParametersRenderer,
ILink link)
Invoked when the form is rendering. |
void |
rewind()
Invoked to rewind the form, which renders the body of the form, allowing form element components to pull data from the request and update page properties. |
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. |
protected void |
writeHiddenField(IMarkupWriter writer,
java.lang.String name,
java.lang.String id,
java.lang.String value)
|
protected void |
writeTag(IMarkupWriter writer,
java.lang.String method,
java.lang.String url)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String FORM_IDS
public static final java.lang.String RESERVED_FORM_IDS
Constructor Detail |
public FormSupportImpl(IMarkupWriter writer, IRequestCycle cycle, IForm form)
Method Detail |
public void addEventHandler(FormEventType type, java.lang.String functionName)
addEventHandler
in interface FormBehavior
public void addHiddenValue(java.lang.String name, java.lang.String value)
FormBehavior
It is acceptible to add multiple hidden fields with the same name. They will be written in the order they are received.
addHiddenValue
in interface FormBehavior
public void addHiddenValue(java.lang.String name, java.lang.String id, java.lang.String value)
FormBehavior
It is acceptible to add multiple hidden fields with the same name. They will be written in the order they are received.
addHiddenValue
in interface FormBehavior
public java.lang.String getElementId(IFormComponent component)
Simply invokes
getElementId(org.apache.tapestry.form.IFormComponent, java.lang.String)
with the
component's id.
getElementId
in interface FormBehavior
public java.lang.String getElementId(IFormComponent component, java.lang.String baseId)
Simply invokes
getElementId(org.apache.tapestry.form.IFormComponent, java.lang.String)
with the
component's id.
getElementId
in interface FormBehavior
public boolean isRewinding()
FormBehavior
isRewinding
in interface FormBehavior
public void render(java.lang.String method, IRender informalParametersRenderer, ILink link)
FormSupport
Form
component.
render
in interface FormSupport
method
- the HTTP method ("get" or "post")informalParametersRenderer
- object that will render informal parameterslink
- The link to which the form will submit (encapsulating the URL and the query
parameters)public void rewind()
FormSupport
Form
component.
rewind
in interface FormSupport
public void setEncodingType(java.lang.String encodingType)
FormBehavior
setEncodingType
in interface FormBehavior
Upload
protected void writeHiddenField(IMarkupWriter writer, java.lang.String name, java.lang.String id, java.lang.String value)
protected void writeTag(IMarkupWriter writer, java.lang.String method, java.lang.String url)
public void prerenderField(IMarkupWriter writer, IComponent field, org.apache.hivemind.Location location)
FormBehavior
FormBehavior.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.
prerenderField
in interface FormBehavior
writer
- the markup writer (from which a nested markup writer is obtained)field
- the field to pre-render. The field is responsible for invoking
FormBehavior.wasPrerendered(IMarkupWriter, IComponent)
.location
- an optional location (of the FieldLabel component) used when reporting errors.public boolean wasPrerendered(IMarkupWriter writer, IComponent field)
FormBehavior
wasPrerendered
in interface FormBehavior
public void addDeferredRunnable(java.lang.Runnable runnable)
FormBehavior
addDeferredRunnable
in interface FormBehavior
runnable
- the object to execute (which may not be null)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |