-
Bug
-
Resolution: Fixed
-
Normal
-
Freshly, 8.0.5, 8.5.0
-
Security Level: Jimmy
-
this problem happens when using ZK EE
in ZK CE the bindings are initialized as expected
-
ZK 8.5.1 R1
Steps to Reproduce
the error can be reproduced with this ZK fiddle
click the buttons
Current Result
Label1 triggers a command in the VM
Label2 does not trigger a command
(changing the visibility flag in the VM also has no effect on the button visibility)
Expected Result
The command and property bindings on both buttons should initialize command and property bindings
Debug Info
This only happens with ZK EE (works in CE) since ZK 8.0.0 EE
(in 7 the dynamically added button doesn't even appear)
Workaround
delay the component creation e.g. by posting an event
(commented out in the fiddle example)
component.addEventListener("onAppendLater", new EventListener() { public void onEvent(Event e) { Executions.createComponents("button2.zul", div1, null); } }); Events.postEvent("onAppendLater", component, null);
Recommended Usage
Don't mix MVVM and MVC pattern. Instead use shadow elements <if>, <apply> and <forEach> to control dynamic component creation.