ZK How to handle multiple events? -
i have textbox , method listens 2 events.
<textbox id="test" /> @listen("onok = #test; onblur = #test") public void action(event event) { // ... }
when press enter on textbox, event "onok " triggered. it's ok. when lose focus texbox event "onblur" triggered too. it's bad, because in case method "action" called 2 times. how can cancel second event ?
you forward event event :
but explication :
in zul :
<textbox id="test" forward="onok=test.onblur"/>
what says onok forwarded onblur, , onblur later on.
in java code :
@listen("onblur = #test") public void action(event event) { clients.shownotification(event.getname() + " " + ++counter); }
so listen onblur because onok forwarded onblur.
will case atm, not yet.
not calling event => not possible, if declare it, triggered.
how can handle situation :
hold string in composer, , check new value.
if it's equal => event triggered, or there no changes.
if it's not equal => stuff.
Comments
Post a Comment