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

Nested Menu with children binding are created for a long time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 8.0.5
    • None

      Steps to Reproduce

      (not complete, extracted from https://forum.zkoss.org/question/111180/popup-dynamic-menu-performance/)
      1. load a zul with a 5 levels menu, 600 menuitems in total

      <menu label="Put data" visible="@load(vm.ownMu)" image="/images/documents.png">
          <menupopup
              children="@bind(vm.reportModel) @template(each.childCount eq 0?'menuitem':'menu')">
              <template name="menu" var="menu">
                  <menu label="@bind(menu.name)"
                      visible="@load(menu.visible)">
                      <menupopup
                          children="@bind(menu.children) @template(each.childCount eq 0?'menuitem':'menu')" />
                  </menu>
              </template>
              <template name="menuitem" var="item">
                  <menuitem
                      label="@bind(item.report ? ''.concat(item.reportData.idreport).concat('. ').concat(item.reportData.shortnamereport):item.name)"
                      onClick="@command(item.report ? 'reportClicked' : '', node=item.reportData)"
                      image="@bind(item.report ? '/images/Excel-16.gif' : '')"
                      disabled="@load(not vm.reader)" visible="@load(item.visible)" />
              </template>
          </menupopup>
      </menu>
      

      Current Result

      performance problem.
      the user said it takes 10 min to load the page.

      Expected Result

      shorter creation time

      Workaround

      replace the children binding with <forEach>

            Unassigned Unassigned
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: