Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-287

The event instance shall be passed to the callback event listener of EventQueue

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.8
    • None
    • ZK Update Engine
    • None

      <window title="test of long operation" border="normal">
      <zscript> <![CDATA[
      import org.zkoss.zk.ui.event.*;

      EventQueue eq = EventQueues.lookup("longop");

      String result = "";

      eq.subscribe(new EventListener() {
      public void onEvent(Event evt)

      { //asynchronous org.zkoss.lang.Threads.sleep(3000); //simulate a long operation result = "success"; //store the result }

      }, new EventListener() { //callback
      public void onEvent(Event evt)

      { alert("evt shall not be null: "+evt); lb.value = result; }

      });
      ]]> </zscript>
      <button label="async long op" onClick='eq.publish(new Event("whatever"));'/>
      <label id="lb"/>
      </window>

            jimmyshiau jimmyshiau
            jimmyshiau jimmyshiau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: