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

Listbox.getVisibleItemCount() does not reset its value after Listbox.setModel()

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 8.0.1
    • Fix Version/s: None
    • Component/s: Components
    • Labels:
    • Environment:

      Windows 10, Microsoft IE 11, Microsoft Edge, Firefox v54, Eclipse Neon3 (4.6.3), jdk 7, tomcat 7

      Description

      I created a java procedure in order to update listbox content using a model.
      This is the code, very simple:

      public void listboxRenderer((List<MyData>) myList) {
          myListbox.setItemRenderer(listitemRenderer);
          ListModelList<MyData> listModelList = new ListModelList<MyData>((List<MyData>) myList);
          myListbox.setModel(listModelList);
          System.out.println("myListboxSize : " + myListbox.getItemCount());
          System.out.println("visibleItemCount : " + myListbox.getVisibleItemCount());
          for (Listitem item : myListbox.getItems()) {
              System.out.println(item + " - " + item.isVisible());
          }
      }
      

      This is the output:

      -----------------------
      availabilityListboxSize : 1
      visibleItemCount : 1
      <Listitem tYEQc4> - true
      -----------------------
      availabilityListboxSize : 1
      visibleItemCount : 2
      <Listitem tYEQz4> - true
      -----------------------
      availabilityListboxSize : 8
      visibleItemCount : 10
      <Listitem tYEQ16> - true
      <Listitem tYEQ36> - true
      <Listitem tYEQ56> - true
      <Listitem tYEQ76> - true
      <Listitem tYEQ96> - true
      <Listitem tYEQb6> - true
      <Listitem tYEQd6> - true
      <Listitem tYEQf6> - true
      -----------------------

      It seems that after applying the model, visibleItemCount increases its value.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            sboscolo sboscolo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: