-
New Feature
-
Resolution: Fixed
-
Later
-
8.0.0
-
Security Level: Jimmy
-
ZK 8.0.1 S1
-
None
unconditional value binding sometimes causes many AU request-response cycles, when the information isn't really required on the server immediately.
here a simple example:
<div viewModel="@id('vm') @init('a.b.c.SomeViewModel')"> <textbox id="t1" value="@bind(vm.text1)"/> <textbox id="t2" value="@load(vm.text2) @save(vm.text2)"/> <textbox id="t3" value="@load(vm.text3) @save(vm.text3, before='save')"/> <button onClick="@command('save')"/> </div>
The textboxes "t1" and "t2" will fire onChange events immediately after the change.
In a simple scenario this can be avoided as in case "t3" by specifying a depending command. This may become cumbersome when multiple commands are used.
In many cases it would be sufficient to mark the onChange event deferrable, to avoid unecessary AU requests to fine tune the application performance.
A way to declare a deferrable (but still unconditional) @save binding would help.
On top of that a library property (or similar mechanism) could be introduced to change the way @save binding listeners are created. This would allow to enable this feature globally or only for a certain component and its subtree, without having to maintain the bindings directly.