public class FormSupportImpl extends Object implements InternalFormSupport, Locatable
| Constructor and Description |
|---|
FormSupportImpl(ComponentResources resources,
String formValidationId)
Constructor used when processing a form submission.
|
FormSupportImpl(ComponentResources resources,
String clientId,
ComponentActionSink actionSink,
boolean clientValidationEnabled,
IdAllocator idAllocator,
String formValidationId)
Full constructor (specifically constructor for render time).
|
| 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.
|
void |
executeDeferred()
Executes any deferred callbacks added via
FormSupport.defer(Runnable). |
String |
getClientId() |
String |
getEncodingType()
Returns the form encoding type, if one has been set via a call to
FormSupport.setEncodingType(String). |
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. |
Location |
getLocation()
Returns the location associated with this object for error reporting purposes.
|
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 FormSupportImpl(ComponentResources resources, String formValidationId)
public FormSupportImpl(ComponentResources resources, String clientId, ComponentActionSink actionSink, boolean clientValidationEnabled, IdAllocator idAllocator, String formValidationId)
public Location getLocation()
LocatablegetLocation in interface Locatablepublic String getFormComponentId()
FormSupportgetFormComponentId in interface FormSupportpublic String allocateControlName(String id)
FormSupportallocateControlName in interface FormSupportid - the component's idpublic <T> void store(T component, ComponentAction<T> action)
FormSupportstore in interface FormSupportpublic <T> void storeCancel(T component, ComponentAction<T> action)
FormSupportEventConstants.CANCELED event.storeCancel in interface FormSupportpublic <T> void storeAndExecute(T component, ComponentAction<T> action)
FormSupportFormSupport.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 FormSupportcomponent - component against which to trigger the actionaction - the action that will be triggered (and passed the component)public void defer(Runnable command)
FormSupportdefer in interface FormSupportcommand - to be executedpublic void executeDeferred()
InternalFormSupportFormSupport.defer(Runnable).executeDeferred in interface InternalFormSupportpublic String getClientId()
getClientId in interface ClientElementpublic String getEncodingType()
InternalFormSupportFormSupport.setEncodingType(String).getEncodingType in interface InternalFormSupportpublic void setEncodingType(String encodingType)
FormSupportsetEncodingType in interface FormSupportencodingType - MIME type indicating type of encoding for the formpublic void addValidation(Field field, String validationName, String message, Object constraint)
FormSupportaddValidation in interface FormSupportfield - 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 boolean isClientValidationEnabled()
FormSupportisClientValidationEnabled in interface FormSupportpublic String getFormValidationId()
FormSupportMessages for validation messages and
constraints. This is normally the simple id of the form.getFormValidationId in interface FormSupportFieldTranslatorSource,
FieldValidatorSource5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.