@command"

From Documentation
m ((via JWB))
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
=Syntax=
 
=Syntax=
  
<tt> @command(</tt> ''[EL-expression], [arbitraryKey]=[EL-expression] '' <tt>) </tt>
+
<code>@command(</code> ''[EL-expression], [arbitraryKey]=[EL-expression] '' <code>)</code>
  
 
= Description =
 
= Description =
Line 40: Line 40:
  
 
=Version History=
 
=Version History=
{{LastUpdated}}
+
 
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-

Latest revision as of 07:35, 8 July 2022

Stop.png This article is out of date, please refer to zk-mvvm-book/8.0/syntax/data_binding/command for more up to date information.


Syntax

@command( [EL-expression], [arbitraryKey]=[EL-expression] )

Description

Target Attribute: event attributes (e.g. onClick, onOK)

Purpose: Specify which command to execute when the event fires

You can pass arbitrary arguments in key-value pairs with comma separated.

[arbitraryKey]=[EL-expression]
It's key-value pairs basically. You can write multiple key-value pairs with different key names.
An EL expression without key is set to a default key named "value" implicitly.
Due to each annotation has different functions, some annotations may ignore key-value pair expression other than default key, e.g.@id.
[arbitraryKey]
It could be any name, it's used as a key for parameter related Java annotation in a ViewModel.


Example

<button label="Save" onClick="@command('saveOrder')" />

<button label="Delete" onClick="@command(empty vm.selected.id?'deleteOrder':'confirmDelete')" />

<button label="Index" onClick="@command('showIndex', index=10, keyword='myKeyword')"/>



Version History

Version Date Content
6.0.0 February 2012 The MVVM was introduced.




Last Update : 2022/07/08

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.