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

ListboxDataLoader doGroupsDataChange finds incorrect offset, causes class cast exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 10.1.0
    • 9.6.4, 10.0.0-Beta
    • None

      Steps to Reproduce

      https://zkfiddle.org/sample/2aa7bt9/3-grouping-rod-error

      • click drop header down button of first header (group)
      • click "group" to set the Listbox to grouping mode (the first item, not the show/hide column checkmark)
      • scroll down to below ROD loading index
      • collapse a group

      Current Result

      java.lang.ClassCastException: org.zkoss.zul.Listitem cannot be cast to org.zkoss.zul.Listgroup
      	at org.zkoss.zul.impl.ListboxDataLoader.doGroupsDataChange(ListboxDataLoader.java:104)
      	at org.zkoss.zul.Listbox.onGroupsDataChange(Listbox.java:2668)
      	at org.zkoss.zul.Listbox.access$1100(Listbox.java:283)
      	at org.zkoss.zul.Listbox$5.onChange(Listbox.java:505)
      	at org.zkoss.zul.AbstractGroupsModel.fireEvent(AbstractGroupsModel.java:72)
      	at org.zkoss.zul.GroupsModelArray.setOpenGroup0(GroupsModelArray.java:254)
      	at org.zkoss.zul.GroupsModelArray.removeOpenGroup(GroupsModelArray.java:240)
      	at org.zkoss.zul.Listgroup.service(Listgroup.java:220)
      	at org.zkoss.zk.ui.impl.DesktopImpl.service(DesktopImpl.java:861)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1312)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:571)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:451)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:459)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:326)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      

      Expected Result

      no error

      Debug Information

      org.zkoss.zul.impl.ListboxDataLoader.doGroupsDataChange(GroupsDataEvent)
      tries to retrieve a Listgroup, but _listbox.getItems().get(offset) returns a regular listitem instead

      Workaround


            jumperchen jumperchen
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: