- Helpers
- Command
Command
Command provides a simple way to execute backing bean methods with javascript.
You can also make the command run when the DOM is ready by setting onload="true"
.
Example
Documentation
<h:form>
<t:message/>
<t:command name="mycommand" action="#{controller.runCommand}"/>
</h:form>
<button onclick="mycommand()">Run mycommand</button>
Command provides a simple way to execute backing bean methods with javascript.
Info
Tag name | command |
---|---|
Component type | io.tornadofaces.component.Command |
Renderer type | io.tornadofaces.component.CommandRenderer |
Attributes
Name | Description | Required |
---|---|---|
name | The name of the client method that will execute the action. | true |
delay | Number of milliseconds delay before the command is executed when called. | false |
repeatOnReload | Repeat the command if onload is true and the component is rendered multiple times. | false |
onload | Execute the action on DOM load. Defaults to false. | false |
action | The action to call when the command is invoked | false |
actionListener | The action listener to call when the command is invoked | false |
immediate | Invoke the action in the Apply Request Values phase. Defaults to false. | false |
render | Space separated list of components to render after ajax. Default "@form". | false |
execute | Space separated list of components to execute on ajax. Default "@form". | false |
beforebegin | JavaScript callback triggered before the AJAX event is assembled. Return false to cancel request. | false |
oncomplete | JavaScript callback triggered before the AJAX request is sent | false |
oncomplete | JavaScript callback triggered after AJAX response has arrived | false |
onsuccess | JavaScript callback triggered after DOM update based on AJAX request | false |
rendered | Should this component be rendered? | false |