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

ZK selector @Listen does not wire listener when button's ancestor is a Window

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Normal Normal
    • None
    • 6.0.0
    • Components
    • None

      Pre-6.0.0 release (6.0.0-RC2) one could wire a listener using the @Listen("onClick = #id") selector, the #id could be a couple of window levels deep from current controlled window. This no longer works. If the #id belongs to a window then one has to specify 'window #id'.

      The following does not work:
      public class TestSelectors extends SelectorComposer<Component> {
      private static final long serialVersionUID = 533541900848152597L;
      @Listen("onClick = #pressMe")
      public void doButtonClick()

      { System.out.println("HELLO"); }

      }

      <window apply="TestSelectors">
      <window>
      <window>
      <button id="pressMe" />
      </window>
      </window
      </window>

      workaround
      If the button is a child of a window:
      <window apply="ctrl">
      <window>
      <button id="pressMe" />
      </window
      </window>
      then you will need to wire it like so:
      @Listen("onClick = window #pressMe")

            SimonPai SimonPai
            nocturnal nocturnal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: