@save"

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/save.html zk-mvvm-book/8.0/syntax/data_binding/save]|}}
  
  
 
=Syntax=
 
=Syntax=
  
<tt> @save(</tt> ''[EL-expression], [conditionKeyword]=[EvaluateOnce EL-expression] '' <tt>) </tt>
+
<code>@save(</code> ''[EL-expression], [conditionKeyword]=[EvaluateOnce EL-expression] '' <code>)</code>
  
 
= Description =
 
= Description =
 
'''Target Attribute:''' any save-allowed attributes (except viewModel, validationMessages)
 
'''Target Attribute:''' any save-allowed attributes (except viewModel, validationMessages)
  
'''Purpose:''' Restrict binder to save data to ViewModel only, not load.
+
'''Purpose:''' Restrict binder to save data to ViewModel only, no loading.
  
You usually use this syntax when you want to save and load data in different conditions, you should write both <tt> @save </tt> and <tt> @load </tt> in an attribute. You have to use it in form binding to save upon a command.
+
You usually use this syntax when you want to save and load data in different conditions, you should write both <code>@save</code> and <code>@load</code> in an attribute. You have to use it in form binding to save upon a command.
  
 
; ''[conditionKeyword]=[EvaluateOnce EL-expression]''
 
; ''[conditionKeyword]=[EvaluateOnce EL-expression]''
Line 21: Line 22:
 
;''[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 41: Line 42:
  
 
</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/save for more up to date information.


Syntax

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

Description

Target Attribute: any save-allowed attributes (except viewModel, validationMessages)

Purpose: Restrict binder to save data to ViewModel only, no loading.

You usually use this syntax when you want to save and load data in different conditions, you should write both @save and @load in an attribute. You have to use it in form binding to save upon a command.

[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

Basic usage

<textbox value="@load(vm.person.name) @save(vm.person.name, before='save')"/>

<textbox value="@load(vm.person.name) @save(vm.person.name, before={'save', 'update'})"/>


Saving and loading form attribute'

<textbox value="@save(vm.number) @load(vm.number, after='cmd')" />



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.