org.apache.tapestry.form
Class MultipleFormSupport
java.lang.Object
org.apache.tapestry.form.FormSupportImpl
org.apache.tapestry.form.MultipleFormSupport
- All Implemented Interfaces:
- FormSupport, FormBehavior
public class MultipleFormSupport
- extends FormSupportImpl
A FormSupport
implementation that can work when a form is
included multiple times in a given page ( due to it being in a loop
or in a component that's included many times in the page).
This is achieved by prefixing the ids of all form elements with the
form's id.
- Since:
- 4.1.1
Methods inherited from class org.apache.tapestry.form.FormSupportImpl |
addDeferredRunnable, addEventHandler, addHiddenValue, addHiddenValue, emitEventManagerInitialization, getElementId, getForm, getHiddenFieldWriter, getProfile, isFormFieldUpdating, isRewinding, prerenderField, registerForFocus, render, setEncodingType, setFormFieldUpdating, wasPrerendered, writeHiddenField, writeHiddenFieldList, writeHiddenFields, writeTag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultipleFormSupport
public MultipleFormSupport(IMarkupWriter writer,
IRequestCycle cycle,
IForm form)
getElementId
public String getElementId(IFormComponent component,
String baseId)
- Constructs a unique identifier (within the page). The identifier consists of the component's
id, with an index number added to ensure uniqueness.
- Specified by:
getElementId
in interface FormBehavior
- Overrides:
getElementId
in class FormSupportImpl
peekClientId
public String peekClientId(IFormComponent comp)
- Description copied from interface:
FormBehavior
- Used internally to "peek" at what the next generated client id will be for the
given component when it renders. Similar to the logic found in
IRequestCycle.peekUniqueId(String)
.
- Specified by:
peekClientId
in interface FormBehavior
- Overrides:
peekClientId
in class FormSupportImpl
- Returns:
- The next possible client ID for the component.
peekClientId
protected String peekClientId(IFormComponent comp,
String baseId)
rewind
public String rewind()
- Description copied from interface:
FormSupport
- 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. This should only be
invoked by the
Form
component.
- Specified by:
rewind
in interface FormSupport
- Overrides:
rewind
in class FormSupportImpl
- Returns:
- a code indicating why the form was submitted:
FormConstants.SUBMIT_NORMAL
,
FormConstants.SUBMIT_CANCEL
or FormConstants.SUBMIT_REFRESH
.
Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.