|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.corelib.internal.FormSupportImpl
public class FormSupportImpl
Provides support to components enclosed by a form when the form is rendering (allowing the components to registry form submit callback commands), and also during form submission time.
TODO: Most methods should only be invokable depending on whether the form is rendering or processing a submission.
Constructor Summary | |
---|---|
FormSupportImpl(ComponentResources resources,
String formValidationId)
Constructor used when processing a form submission. |
|
FormSupportImpl(ComponentResources resources,
String clientId,
ComponentActionSink actionSink,
ClientBehaviorSupport clientBehaviorSupport,
boolean clientValidationEnabled,
IdAllocator idAllocator,
String formValidationId)
Full constructor (specifically constructor for render time). |
Method Summary | ||
---|---|---|
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. |
|
|
store(T component,
ComponentAction<T> action)
Stores an action for execution during a later request. |
|
|
storeAndExecute(T component,
ComponentAction<T> action)
As with FormSupport.store(Object, org.apache.tapestry5.ComponentAction) }, but the action is also invoked
immediately. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormSupportImpl(ComponentResources resources, String formValidationId)
public FormSupportImpl(ComponentResources resources, String clientId, ComponentActionSink actionSink, ClientBehaviorSupport clientBehaviorSupport, boolean clientValidationEnabled, IdAllocator idAllocator, String formValidationId)
Method Detail |
---|
public Location getLocation()
Locatable
getLocation
in interface Locatable
public String getFormComponentId()
FormSupport
FormInjector
.
getFormComponentId
in interface FormSupport
public String allocateControlName(String id)
FormSupport
allocateControlName
in interface FormSupport
id
- the component's id
public <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 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |