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 :

i created fiddle can test it.

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

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -