My button on zul file using MVVM.
<button id="ok" label="OK" onClick="@command('vm.myCommand')"/>
my vm
@Command
public void myCommand(){
System.out.println('my command clicked');
}
It display twice when I double click on my button. How to prevent this?
use autodisable
attribute of button please have a look below code.
<zk>
<button id="ok" label="OK" autodisable="self" />
</zk>
You can run this code in zk Fiddle .When you click on button it automatically disable itself and when action is done it enable again.
Not related to your concrete problem but ZK Progree Bar another option to prevent user click after any action performed by user.