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()
Returns a unique id for the element.
|
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()
Locatable
getLocation
in interface Locatable
public String getFormComponentId()
FormSupport
getFormComponentId
in interface FormSupport
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 storeCancel(T component, ComponentAction<T> action)
FormSupport
EventConstants.CANCELED
event.storeCancel
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 executeDeferred()
InternalFormSupport
FormSupport.defer(Runnable)
.executeDeferred
in interface InternalFormSupport
public String getClientId()
ClientElement
getClientId
in interface ClientElement
public String getEncodingType()
InternalFormSupport
FormSupport.setEncodingType(String)
.getEncodingType
in interface InternalFormSupport
public 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 boolean isClientValidationEnabled()
FormSupport
isClientValidationEnabled
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
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.