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

Listbox uses deprecated setPreloadSize instead of library property org.zkoss.zul.listbox.preloadSize

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.0
    • 8.0.4
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      See fiddle:
      http://zkfiddle.org/sample/26euevb/1-ListboxCeRod
      Put a breakpoint in Listbox.service() here:
      https://github.com/zkoss/zk/blob/master/zul/src/org/zkoss/zul/Listbox.java

      Actual Result

      The _preloadsz value used to control the number of rendered items is default (50) or the value set by .setPreloadSize(value) in java or preloadSize="value" in zul (both deprecated)
      The library property is only used for EE Rod
      https://www.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_Library_Properties/org.zkoss.zul.listbox.preloadSize

      Expected Result

      The library property should affect the preloadsz, and take priority over the deprecated methods

      Debug Info

      the int preloadSize() method already provide the expected calculation, but is only used for EE Rod:
      https://github.com/zkoss/zk/blob/master/zul/src/org/zkoss/zul/Listbox.java#L3508
      https://github.com/zkoss/zk/blob/master/zul/src/org/zkoss/zul/Listbox.java#L3430

      Root Cause

      Workaround

      Use .setPreloadSize() or <listbox preloadSize=""/> instead

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

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d