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

custom attribute org.zkoss.zul.listbox.preloadSize doesn't affect smart loading Listbox

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Normal Normal
    • None
    • 7.0.5, 8.0.3
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      Run fiddle
      http://zkfiddle.org/sample/qohkpu/2-Smart-listbox-initial-size

      Actual Result

      Listbox initially loads 50 items

      Expected Result

      Listbox initially loads 1000 items (as defined in the preloadSize attribute)

      Debug Info

      With rod=true, preloadSize currently controls the number of listitems loaded during each loading cycle.
      It might be better to have different attributes for Listbox ROD and Smart listbox loading.

      Root Cause

      Workaround

      It is possible to target a number of items to load using listbox.renderItems(set<Listitem> items):

      			private Set myItemsToRender = new HashSet();
      			for (int i = 0; i < 1000; i++) {
      				myItemsToRender.add(box.getItemAtIndex(i));
      			}
      			box.renderItems(myItemsToRender);
      

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

              Created:
              Updated:
              Resolved: