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

Shadow Element NPE when setting on a parent outside of a page

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.0.2
    • 8.0.2, 8.0.1.1
    • None
    • Security Level: Jimmy
    • None

      In org.zkoss.zk.ui.HtmlShadowElement.setShadowHost(Component, Component) - line 241
      host.getDesktop().getWebApp().getConfiguration().afterShadowAttached(this, host)
      will throw a NPE if the component host have a parent, but is not attached to a page.

      This may happen when using createComponents or createComponentDirectly to generate components based on a zul fragment without entering a page.

      A more informative exception could be something like:
      [element] Shadow Element parent cannot be detached

      see the attached example.

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

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours
                5h