For example, you could have one action state handle form setup, a view state triggerįorm display, another action state handle data binding and validation, and another process form submission. When you need additional flexibility consider splitting the view state above acting as a single logical form Here is an example implementation of such a form flow: If business processing is ok, continue to a view state to display the success view.This will invoke an action method called "processSubmit" you must provide on a subclass to process form If binding and validation are successful go to an action state called "processSubmit" (or any other appropriate.If there are binding or validation errors, the transition will not be allowed and the view state will.On a matching "submit" transition execute an action that invokes bindAndValidate to bind incoming request parameters to the form object and validate the form object.SetupForm to prepare the new form for display. Create a view state to display the form.Using this action, it becomes very easy to implement form preparation and submission logic in your flow. "setupReferenceData(RequestContext)", or "processSubmit(RequestContext)". Since this is a multi-action a subclass could add any number of additional action execution methods, e.g. Returns "success" on completion, an exception is thrown when a failure occurs. resetForm(RequestContext) - Resets the form by reloading the backing form object and reinstalling anyĬustom property editors.This action method will return the "success" event if there are no validation errors, otherwise it will validate(RequestContext) - Validates the form object using a registered validator.This action method will return the "success" event if there are no binding errors, otherwise bind(RequestContext) - Binds all incoming request parameters to the form object.Return the "success" event if there are no binding or validation errors, otherwise it will return the "error" event. Validates the form object using a registered validator. bindAndValidate(RequestContext) - Binds all incoming request parameters to the form object and then.This action method will return the "success" event unless Property editors for formatting form object field values. setupForm(RequestContext) - Prepares the form object for display on a form,Ĭreating it and an associated errors if necessary, thenĬaching them in the configured form object scope and formĮrrors scope, respectively. Several action execution methods are provided: This class uses the Spring Web data binding code Multi-action that implements common logic dealing with input forms.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |