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

HtmlMacroComponent doesn't listen to onCreate event with @Listen

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.0
    • 8.5.2
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.6.0 S1, ZK 8.6.0 S2
    • None

      Steps to Reproduce

      1. run the attached file 4016.zul
      2. check server console

      Current Result

      it doesn't print anything when the listbox is created
      @Listen doesn't work correctly inside a HTMLMacroComponent

      Expected Result

      print onCreate event information

      Debug Information

      • 8.5.1.2 works correctly.
      • in HtmlMacroComponent's constructor, call getRoot().addEventListener("onCreate", ...) works as expected.

      Workaround

      • add an event listener with addEventListener()
        getRoot().addEventListener("onCreate", ...)
      • listen to onCreate in a composer instead of inside a HtmlMacroComponent subclass
      • replace a macro with a <apply> like:

        1. 4016.zul
          0.2 kB
        2. 4016-mylistbox.zul
          0.5 kB
        3. MyListbox.java
          1 kB
        4. T5220Composer.java
          0.4 kB

            DevChu DevChu
            hawk hawk
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 weeks
                4w
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified Time Not Required
                Not Specified