Skip to content

Commit c81d160

Browse files
committed
docs: update formActionSubmit documentation
1 parent 3cf7d70 commit c81d160

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

grails-doc/src/en/ref/Tags - GSP/formActionSubmit.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ Creates a submit button that sets the `formaction` attribute, which allows one t
6161

6262
Attributes
6363

64-
* `value` (required) - The caption of the button and name of action when not explicitly defined.
65-
* `id` (optional) - The element id of the input element
66-
* `action` (optional) - The name of the action to use in the link; if not specified the default action will be linked
67-
* `controller` (optional) - The name of the controller to use in the link; if not specified the current controller will be linked
68-
* `namespace` (optional) - The namespace of the controller to use in the link
69-
* `plugin` (optional) - The name of the plugin which provides the controller
70-
* `id` (optional) - The id to use in the link
71-
* `fragment` (optional) - The link fragment (often called anchor tag) to use
72-
* `mapping` (optional) - The link:{guidePath}/theWebLayer.html#namedMappings to use to rewrite the link
73-
* `method` (optional) - The HTTP method specified in the corresponding URL mapping
74-
* `params` (optional) - A map containing URL query parameters for the link
75-
* `url` (optional) - A Map containing the action, controller, id etc.
64+
* `value` (required) - The label shown on the submit button.
65+
* `id` (optional) - The DOM id of the rendered input element.
66+
* `disabled` (optional) - Disables the rendered button when the value evaluates to true.
67+
* `action` (optional) - The name of the action to use in the link; if not specified the default action will be linked.
68+
* `controller` (optional) - The name of the controller to use in the link; if not specified the current controller will be linked.
69+
* `namespace` (optional) - The namespace of the controller to use in the link.
70+
* `plugin` (optional) - The name of the plugin which provides the controller.
71+
* `fragment` (optional) - The link fragment (often called anchor tag) to use.
72+
* `mapping` (optional) - The link:{guidePath}/theWebLayer.html#namedMappings to use to rewrite the link.
73+
* `method` (optional) - The HTTP method specified in the corresponding URL mapping.
74+
* `params` (optional) - A map containing URL query parameters for the link.
75+
* `url` (optional) - A Map containing the action, controller, id, etc. for the generated link. If the target URL needs an `id`, provide it here because the top-level `id` attribute is used for the input element.
7676
* `uri` (optional) - A string for a relative path in the running app.
7777
* `relativeUri` (optional) - Used to specify a uri relative to the current path.
7878
* `absolute` (optional) - If `true` will prefix the link target address with the value of the `grails.serverURL` property from the application configuration, or http://localhost:8080 if there is no setting in the config and not running in production.

grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/taglib/FormTagLib.groovy

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -557,23 +557,27 @@ class FormTagLib implements ApplicationContextAware, InitializingBean, TagLibrar
557557

558558
/**
559559
* Creates a submit button using the `formaction` attribute to submit to a different action than the form.
560-
* The action will be generated by the various link attributes.<br/>
560+
* The target URL is generated from the supported link attributes.<br/>
561+
* The rendered `&lt;input&gt;` uses this tag's `id` attribute for its DOM id. If the generated URL needs an
562+
* `id`, provide it through the `url` map.<br/>
561563
*
562564
* &lt;g:formActionSubmit action="myaction" value="Submit"/&gt;<br/>
563565
* &lt;g:formActionSubmit controller="myctrl" action="myaction" value="ButtonName"/&gt;<br/>
564566
*
565-
* @attr id the id attribute of the formActionSubmit tag
566-
* @attr value the button's show value
567-
* @attr action The name of the action to use in the link, if not specified the default action will be linked
568-
* @attr controller The name of the controller to use in the link, if not specified the current controller will be linked
569-
* @attr namespace The namespace of the controller to use in the link
567+
* @emptyTag
568+
*
569+
* @attr value REQUIRED The label shown on the submit button
570+
* @attr id DOM id for the rendered input element
571+
* @attr disabled Makes the button disabled. Will be interpreted as a Groovy Truth
572+
* @attr action The name of the action to use in the generated link, if not specified the default action will be linked
573+
* @attr controller The name of the controller to use in the generated link, if not specified the current controller will be linked
574+
* @attr namespace The namespace of the controller to use in the generated link
570575
* @attr plugin The name of the plugin which provides the controller
571-
* @attr id The id to use in the link
572576
* @attr fragment The link fragment (often called anchor tag) to use
573577
* @attr mapping The named URL mapping to use to rewrite the link
574578
* @attr method The HTTP method specified in the corresponding URL mapping
575579
* @attr params A map containing URL query parameters for the link
576-
* @attr url A map containing the action, controller, id etc.
580+
* @attr url A map containing the action, controller, id etc. for the generated link
577581
* @attr uri A string for a relative path in the running app.
578582
* @attr relativeUri Used to specify a uri relative to the current path.
579583
* @attr absolute If set to "true" will prefix the link target address with the value of the grails.serverURL property from Config, or http://localhost:&lt;port&gt; if no value in Config and not running in production.

0 commit comments

Comments
 (0)