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

org.zkoss.zk.ui.UiException: view model of 'vm' is null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.6.2
    • Fix Version/s: 8.6.3
    • Component/s: Databind 2
    • Security Level: Jean
    • Labels:
      None

      Description

      I have a main ZUL file (in this example index.zul) that includes other ZUL files via apply element. The templateURL is dynamically and loaded via MVVM

      <apply templateURI="@init(mainVM.headerLayout)" vmClass="@init(mainVM.headerVmClass)"/>

      With ZK 8.6.2 I get org.zkoss.zk.ui.UiException in included ZUL file (in this example header.zul)

      When I change the templateURI to static value, it works with ZK 8.6.2

      <apply templateURI="/header.zul" vmClass="@init(mainVM.headerVmClass)"/>

      Steps to Reproduce

      zk862.zip

      Start enclose example with ZK 8.6.2 http://<server>:<port>/zk862/index.zul

      Change in pom.xml the ZK version to 8.6.1 and repeat step one, now it works.

      Workaround

       flip the order of properties then vmClass is loaded before evaluating the templateURI

      <apply vmClass="@init(mainVM.headerVmClass)" templateURI="@init(mainVM.headerLayout)" />

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                DevChu DevChu
                Reporter:
                karlflamensbeck karlflamensbeck
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: