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

HtmlMacroComponent compose() doesn't resolve @Wire before doAfterCompose

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 8.5.2
    • 8.5.2
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      Run attached project
      Open the test.zul page

      Current Result

      the line1 component is not wired during doAfterCompose(), which causes a NPE

      Expected Result

      the line1 component is wired during doAfterCompose(), which allow doAfterCompose logic to access the component

      Debug Info

      After change:
      https://github.com/zkoss/zk/blob/c400ef364856fc457031c6f7276472f82a6a3364/zk/src/org/zkoss/zk/ui/HtmlMacroComponent.java#L175
      During compose, the MacroComponent register an event to @Wire components later

      Before change:
      https://github.com/zkoss/zk/blob/dcdff5594b66c63f0659e6fa8de47cf3bfa45869/zk/src/org/zkoss/zk/ui/HtmlMacroComponent.java#L174
      Component wiring happen directly during compose()

      Root Cause

      Issue introduced by ZK-3843
      https://github.com/zkoss/zk/commit/c400ef364856fc457031c6f7276472f82a6a33643

            klyvechen klyvechen
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: