From Documentation

Jump to: navigation, search

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.



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


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.
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.


Basic usage

<textbox value="@load( @save(, before='save')"/>

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

Saving and loading form attribute'

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

Version History

Last Update : 2015/5/28

Version Date Content
6.0.0 February 2012 The MVVM was introduced.

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