-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Binder loads value to UI before event is triggered, what should I do, if I want binder to trigger after event?
Here is simple example. Button is not disabled after first click, because binder has triggered before onClick event while disabled == false. The second click disables button :-) but I need it on the first click.
ZK 3.6.4
<zk xmlns="http://www.zkoss.org/2005/zul"> <window> <zscript> boolean disable = false; </zscript> <button id="button" label="clickMe" disabled="@{disable, load-when='button.onClick'}"> <attribute name="onClick"> disable=true; </attribute> </button> </window> </zk>
Use load-after instead of load-when. This way the binder does his work after the event.
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./mywin"?> <window id="mywin"> <zscript> boolean disable = false; </zscript> <button id="button" label="clickMe" disabled="@{disable, load-after='button.onClick'}"> <attribute name="onClick"> disable=true; </attribute> </button> </window>
How to disable screen on button click???
i want to gray out the screen on button click, my progressbox appears on some process works can we disable screen on processbox processing??
Asked: 2010-04-21 05:13:29 +0800
Seen: 1,076 times
Last updated: Dec 02 '10