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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 8.6.3
    • 8.6.2
    • Databind 2
    • Security Level: Jean
    • None

      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)" />

       

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

              Created:
              Updated:
              Resolved: