-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #551 - replace actionSubmit with formActionSubmit
- Loading branch information
1 parent
416e832
commit 238b097
Showing
5 changed files
with
161 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
== formActionSubmit | ||
|
||
|
||
|
||
=== Purpose | ||
|
||
|
||
Creates a submit button that submits to an `formaction` generated by the various link attributes. | ||
|
||
|
||
=== Examples | ||
|
||
|
||
[,xml] | ||
---- | ||
<!--Generates a label of 'Update' submitting to `update` action on the current controller--> | ||
<g:formActionSubmit value="Update" /> | ||
<!--'Update' is action, label is 'Some update label'--> | ||
<g:formActionSubmit value="Some update label" action="update" /> | ||
<!--'Update' is action on the controller 'index', label is 'Some update label'--> | ||
<g:formActionSubmit value="Some update label" controller="index" action="update" /> | ||
<!--label derived from message bundle--> | ||
<g:formActionSubmit value="${message(code:'label.update')}" action="update" /> | ||
<g:formActionSubmit value="Delete" /> | ||
<g:formActionSubmit value="DeleteAll" | ||
onclick="return confirm('Are you sure???')" /> | ||
---- | ||
|
||
|
||
=== Description | ||
|
||
|
||
Attributes | ||
|
||
* `action` (optional) - The name of the action to use in the formaction; if not specified the default action will be used | ||
* `controller` (optional) - The name of the controller to use in the formaction; if not specified the current controller will be used | ||
* `namespace` (optional) - the namespace of the controller to use in the formaction | ||
* `plugin` (optional) - the name of the plugin which provides the controller | ||
* `id` (optional) - The element id of the input element | ||
* `fragment` (optional) - The link fragment (often called anchor tag) to use in the formaction | ||
* `mapping` (optional) - The {grailsdocs}guide/theWebLayer.html#namedMappings[named URL mapping] to use to rewrite the formaction | ||
* `params` (optional) - A Map of request parameters for the formaction | ||
* `url` (optional) - A Map containing the action,controller,id etc for the for the formaction. | ||
* `uri` (optional) - A string for a relative path in the running app | ||
* `relativeUri` (optional) - Used to specify a uri relative to the current path for the formaction | ||
* `absolute` (optional) - If `true` will prefix the formaction target address with the value of the `grails.serverURL` property from the application configuration, or http://localhost:<port> if there is no setting in the config and not running in production. | ||
* `base` (optional) - Sets the prefix to be added to the formaction target address, typically an absolute server URL. This overrides the behaviour of the `absolute` property if both are specified. | ||
* `event` (optional) - The name of a Webflow event to trigger for the flow associated with the given `action`. Requires the Webflow plugin. | ||
* `value` (required) - The caption of the button and name of action when not explicitly defined. | ||
|
||
When you use a normal submit button inside a form, it is the form itself that determines what URL the request is sent to, and therefore what action is executed. However, this tag overrides that behaviour and determines which action is executed by the specified attributes. This tag supports any controller & action. |