@load"

From Documentation
m ((via JWB))
 
(6 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/load.html zk-mvvm-book/8.0/syntax/data_binding/load]|}}
  
  
 
=Syntax=
 
=Syntax=
  
<tt> @load(</tt> ''[EL-expression], [conditionKeyword]=[EvaluateOnce EL-expression] '' <tt>) </tt>
+
<code>@load(</code> ''[EL-expression], [conditionKeyword]=[EvaluateOnce EL-expression] '' <code>)</code>
  
 
= Description =
 
= Description =
Line 11: Line 12:
 
'''Purpose:''' Restrict binder to load data from ViewModel only, not save back
 
'''Purpose:''' Restrict binder to load data from ViewModel only, not save back
  
For some attributes that don't save data back to ViewModel like listbox's model or label's value, it's equal to write <tt> @bind </tt> or <tt> @load </tt>.
+
For some attributes that don't save data back to the ViewModel like listbox's model or label's value, you can also write <code>@bind</code> or <code>@load</code>.
  
  
Line 23: Line 24:
 
;''[EvaluateOnce EL-expression]''
 
;''[EvaluateOnce EL-expression]''
 
: The evaluation result must be one or more command name.
 
: The evaluation result must be one or more command name.
: Command name must correspond to the name specified in Java annotation <tt> @Command </tt> in a ViewModel.
+
: Command name must correspond to the name specified in Java annotation <code>@Command</code> in a ViewModel.
  
 
= Example =
 
= Example =
Line 37: Line 38:
 
<label value="@load(vm.user.action, before='process')" />
 
<label value="@load(vm.user.action, before='process')" />
 
</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

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


Syntax

@load( [EL-expression], [conditionKeyword]=[EvaluateOnce EL-expression] )

Description

Target Attribute: any (except viewModel, validationMessages)

Purpose: Restrict binder to load data from ViewModel only, not save back

For some attributes that don't save data back to the ViewModel like listbox's model or label's value, you can also write @bind or @load.


[conditionKeyword]=[EvaluateOnce EL-expression]
This expression is optional unless you want to save or load upon a command.
[conditionKeyword]
It could be one of [ before | after ]
[EvaluateOnce EL-expression]
The evaluation result must be one or more command name.
Command name must correspond to the name specified in Java annotation @Command in a ViewModel.

Example

<label value="@load(vm.user.id)" />

<label value="@load(vm.user.permission, after='showPermission')" />

<label value="@load(vm.user.permission, after={'showPermission', 'showAll'})" />

<label value="@load(vm.user.action, before='process')" />



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.