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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.0.4
    • Fix Version/s: 8.5.0
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

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