|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.corelib.components.Form
public class Form
An HTML form, which will enclose other components to render out the various types of fields.
A Form emits many notification events. When it renders, it fires aEventConstants.PREPARE_FOR_RENDER
notification, followed by a EventConstants.PREPARE notification.
When the form is submitted, the component emits several notifications: first a EventConstants.PREPARE_FOR_SUBMIT, then a EventConstants.PREPARE:
these allow the page to update its state as necessary to prepare for the form submission, then (after components
enclosed by the form have operated), a EventConstants.VALIDATE_FORM event is emitted, to
allow for cross-form validation. After that, either a EventConstants.SUCCESS OR EventConstants.FAILURE event (depending on whether the ValidationTracker has recorded
any errors). Lastly, a EventConstants.SUBMIT event, for any listeners that care only
about form submission, regardless of success or failure.
For all of these notifications, the event context is derived from the context parameter. This
context is encoded into the form's action URI (the parameter is not read when the form is submitted, instead the
values encoded into the form are used).
| Field Summary | |
|---|---|
static String |
FAILURE
Deprecated. Use constant from EventConstants instead. |
static String |
FORM_DATA
Query parameter name storing form data (the serialized commands needed to process a form submission). |
static String |
PREPARE
Deprecated. Use constant from EventConstants instead. |
static String |
PREPARE_FOR_RENDER
Deprecated. Use constant from EventConstants instead. |
static String |
PREPARE_FOR_SUBMIT
Deprecated. Use constant from EventConstants instead. |
static String |
SUBMIT
Deprecated. Use constant from EventConstants instead. |
static String |
SUCCESS
Deprecated. Use constant from EventConstants instead. |
static String |
VALIDATE_FORM
Deprecated. Use constant from EventConstants instead. |
| Constructor Summary | |
|---|---|
Form()
|
|
| Method Summary | |
|---|---|
void |
clearErrors()
Invokes ValidationTracker.clear(). |
String |
getClientId()
Forms use the same value for their name and their id attribute. |
ValidationTracker |
getDefaultTracker()
|
boolean |
getHasErrors()
Returns true if the form's ValidationTracker contains any errors. |
boolean |
isValid()
Returns true if the form's ValidationTracker does not contain any errors. |
void |
recordError(Field field,
String errorMessage)
A convienience for invoking ValidationTracker.recordError(Field, String). |
void |
recordError(String errorMessage)
A convienience for invoking ValidationTracker.recordError(String). |
void |
setDefaultTracker(ValidationTracker defaultTracker)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PREPARE_FOR_RENDER
EventConstants instead.public static final String PREPARE_FOR_SUBMIT
EventConstants instead.public static final String PREPARE
EventConstants instead.public static final String SUBMIT
EventConstants instead.public static final String VALIDATE_FORM
EventConstants instead.public static final String SUCCESS
EventConstants instead.public static final String FAILURE
EventConstants instead.public static final String FORM_DATA
| Constructor Detail |
|---|
public Form()
| Method Detail |
|---|
public ValidationTracker getDefaultTracker()
public void setDefaultTracker(ValidationTracker defaultTracker)
public void recordError(String errorMessage)
FormValidationControlValidationTracker.recordError(String).
recordError in interface FormValidationControl
public void recordError(Field field,
String errorMessage)
FormValidationControlValidationTracker.recordError(Field, String).
recordError in interface FormValidationControlpublic boolean getHasErrors()
FormValidationControlValidationTracker contains any errors.
getHasErrors in interface FormValidationControlpublic boolean isValid()
FormValidationControlValidationTracker does not contain any errors.
isValid in interface FormValidationControlpublic void clearErrors()
FormValidationControlValidationTracker.clear().
clearErrors in interface FormValidationControlpublic String getClientId()
getClientId in interface ClientElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||