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

HtmlMacroComponent doesn't listen to onCreate event with @Listen

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.5.2
    • Fix Version/s: 8.6.0
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.6.0 S1, ZK 8.6.0 S2

      Description

      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:

        Attachments

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

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

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