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

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

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.8
    • Component/s: ZK Update Engine
    • Labels:
      None

      Description

      <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>

        Activity

        Hide
        jimmyshiau jimmyshiau added a comment -

        Ready since Aug 8 2011

        Show
        jimmyshiau jimmyshiau added a comment - Ready since Aug 8 2011

          People

          • Assignee:
            jimmyshiau jimmyshiau
            Reporter:
            jimmyshiau jimmyshiau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: