public class FormSupportAdapter extends Object implements FormSupport
FormSupport
that delegates all behavior to another
instance of FormSupport. This allows some of the behavior to be overridden easily.Constructor and Description |
---|
FormSupportAdapter(FormSupport delegate) |
Modifier and Type | Method and Description |
---|---|
void |
addValidation(Field field,
String validationName,
String message,
Object constraint)
Collects field validation information.
|
String |
allocateControlName(String id)
Allocates a unique (within the form) control name for some enclosed component, based on the component's id.
|
void |
defer(Runnable command)
Defers a command until the end of the form submission.
|
String |
getClientId() |
String |
getFormComponentId()
Returns the complete id of the underlying Form component.
|
String |
getFormValidationId()
Id used as a prefix when searching
Messages for validation messages and
constraints. |
boolean |
isClientValidationEnabled()
Return true if client validation is enabled for this form, false otherwise.
|
void |
setEncodingType(String encodingType)
Sets the encoding type for the Form.
|
<T> void |
store(T component,
ComponentAction<T> action)
Stores an action for execution during a later request.
|
<T> void |
storeAndExecute(T component,
ComponentAction<T> action)
As with
FormSupport.store(Object, org.apache.tapestry5.ComponentAction) }, but the action is also invoked
immediately. |
<T> void |
storeCancel(T component,
ComponentAction<T> action)
Stores an action for execution in a later request when the containing form is canceled.
|
public FormSupportAdapter(FormSupport delegate)
public String allocateControlName(String id)
FormSupport
allocateControlName
in interface FormSupport
id
- the component's idpublic <T> void store(T component, ComponentAction<T> action)
FormSupport
store
in interface FormSupport
public <T> void storeAndExecute(T component, ComponentAction<T> action)
FormSupport
FormSupport.store(Object, org.apache.tapestry5.ComponentAction)
}, but the action is also invoked
immediately. This is useful for defining an action that should occur symmetrically in both the render request and
the form submission's action request.storeAndExecute
in interface FormSupport
component
- component against which to trigger the actionaction
- the action that will be triggered (and passed the component)public void defer(Runnable command)
FormSupport
defer
in interface FormSupport
command
- to be executedpublic void setEncodingType(String encodingType)
FormSupport
setEncodingType
in interface FormSupport
encodingType
- MIME type indicating type of encoding for the formpublic void addValidation(Field field, String validationName, String message, Object constraint)
FormSupport
addValidation
in interface FormSupport
field
- for which validation is being generatedvalidationName
- name of validation method (see Tapestry.Validation in tapestry.js)message
- the error message to display if the field is invalidconstraint
- additional constraint value, or null for validations that don't require a constraintpublic String getClientId()
getClientId
in interface ClientElement
public boolean isClientValidationEnabled()
FormSupport
isClientValidationEnabled
in interface FormSupport
public String getFormComponentId()
FormSupport
getFormComponentId
in interface FormSupport
public String getFormValidationId()
FormSupport
Messages
for validation messages and
constraints. This is normally the simple id of the form.getFormValidationId
in interface FormSupport
FieldTranslatorSource
,
FieldValidatorSource
public <T> void storeCancel(T component, ComponentAction<T> action)
FormSupport
EventConstants.CANCELED
event.storeCancel
in interface FormSupport
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.