@GlobalCommand"
From Documentation
(Created page with "{{ZKDevelopersReferencePageHeader}} =Syntax= <source lang="java"> @Command() @Command("commanName") @Command({"commanName1", "commandName2"}) </source> = Description = '''...") |
m ((via JWB)) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ZKDevelopersReferencePageHeader}} | {{ZKDevelopersReferencePageHeader}} | ||
+ | {{Deprecated | url=[http://books.zkoss.org/zk-mvvm-book/8.0/syntax/viewmodelglobalcommand.html zk-mvvm-book/8.0/syntax/viewmodel/globalcommand]|}} | ||
+ | |||
=Syntax= | =Syntax= | ||
<source lang="java"> | <source lang="java"> | ||
− | @ | + | @GlobalCommand |
− | @ | + | @GlobalCommand("commanName") |
− | @ | + | @GlobalCommand({"commanName1", "commandName2"}) |
</source> | </source> | ||
Line 13: | Line 15: | ||
'''Target:''' method | '''Target:''' method | ||
− | '''Purpose:''' To identify a | + | '''Purpose:''' To identify a global command method. |
− | The optional annotation's element is a String for command's name and that name is referenced in a ZUL with | + | The optional annotation's element is a String for command's name and that name is referenced in a ZUL with global command binding. If it's not provided, method name is set as the command name by default. |
− | We | + | We can use parameter related annotation on command method's parameters, please refer to subsections of [[ZK Developer's Reference/MVVM/Syntax/ViewModel/Parameters | Parameters]] for more information. |
= Example = | = Example = | ||
Line 24: | Line 26: | ||
<source lang="java"> | <source lang="java"> | ||
− | @ | + | @GlobalCommand |
− | public void | + | public void show(){ |
− | + | //... | |
− | |||
− | |||
} | } | ||
Line 36: | Line 36: | ||
<source lang="java"> | <source lang="java"> | ||
− | @Command("delete") | + | @Command("delete") @GlobalCommand("delete") |
public void deleteOrder(){ | public void deleteOrder(){ | ||
− | + | //... | |
− | |||
− | |||
} | } | ||
</source> | </source> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | =Version History= | ||
+ | |||
+ | {| class='wikitable' | width="100%" | ||
+ | ! Version !! Date !! Content | ||
+ | |- | ||
+ | | 6.0.0 | ||
+ | | February 2012 | ||
+ | | The MVVM was introduced. | ||
+ | |} | ||
+ | |||
+ | |||
{{ZKDevelopersReferencePageFooter}} | {{ZKDevelopersReferencePageFooter}} |
Latest revision as of 07:35, 8 July 2022
This article is out of date, please refer to zk-mvvm-book/8.0/syntax/viewmodel/globalcommand for more up to date information.
Syntax
@GlobalCommand
@GlobalCommand("commanName")
@GlobalCommand({"commanName1", "commandName2"})
Description
Target: method
Purpose: To identify a global command method.
The optional annotation's element is a String for command's name and that name is referenced in a ZUL with global command binding. If it's not provided, method name is set as the command name by default.
We can use parameter related annotation on command method's parameters, please refer to subsections of Parameters for more information.
Example
Method name as command name
@GlobalCommand
public void show(){
//...
}
Specify command name
@Command("delete") @GlobalCommand("delete")
public void deleteOrder(){
//...
}
Version History
Version | Date | Content |
---|---|---|
6.0.0 | February 2012 | The MVVM was introduced. |