@OnAJAXSubmit
This annotation is defined on the Presentation Layer.
Target: Method of a POJO annotated with @StageDefinition.
Description: Marks a method to be executed when a given form is submitted.
The supported return types are:
- Bean: Will add a node called "result" with the string content
- String: Will add a node called "result" with the string content
- boolean: Will add a node called "result" with the boolean content
- List: Will add a node called "result" with the array of parsed objects (parsed like normal beans or supported primitives)
- Map: Will add an array of nodes with the key/value pairs. The keys must be Strings, and the values will be parsed like normal beans or supported primitives
- IJSONResponse: Any implementation of a JSON response.
- void: Will ignore the result. The AJAX will consume any content placed in the stage results map and create the result from it.
JavaDoc: Click here
Attributes:
Name |
Description |
Data type |
Required |
Default value |
value |
The name of the form to link to the method. |
String |
Yes |
- |
Example:
public class LoginStage {
// Ties the method to the OnSubmit event of the "myform" form.
@OnAJAXSubmit("myform")
public Map<String, Object> aMethod() {
...
}
}
See also:
Back to annotation reference