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

NPE + IndexOutOfBoundsException when replacing a listitem

XMLWordPrintable

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

      Steps to Reproduce

      run the attached example rod-list-replace.zul
      1. scroll to the bottom of the listbox dragging the scrollbar
      2. scroll down again
      3. click the last listitem

      Current Result

      1. the scroll position will jump up again ~50% of the height
      2. the scroll position remains at the bottom
      3. 3 exceptions are thrown:

      java.lang.IndexOutOfBoundsException: Index: 276, Size: 160
      	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
      	at java.util.ArrayList.get(ArrayList.java:429)
      	at org.zkoss.zul.ListModelList.getElementAt(ListModelList.java:158)
      	at org.zkoss.zul.Listbox$Renderer.render(Listbox.java:2759)
      	at org.zkoss.zul.Listbox.renderItems(Listbox.java:2891)
      	at org.zkoss.zkmax.zul.impl.LiveListboxDataLoader.loadModelAndRenderItems(LiveListboxDataLoader.java:292)
      	at org.zkoss.zkmax.zul.impl.LiveListboxDataLoader.access$200(LiveListboxDataLoader.java:60)
      	at org.zkoss.zkmax.zul.impl.LiveListboxDataLoader$1.onEvent(LiveListboxDataLoader.java:321)
      	at org.zkoss.zkmax.zul.impl.LiveListboxDataLoader$1.onEvent(LiveListboxDataLoader.java:310)
      	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3165)
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3135)
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3077)
      	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1846)
      ...
      
      java.lang.NullPointerException
      	at org.zkoss.zul.Listbox$Renderer.render(Listbox.java:2754)
      	at org.zkoss.zul.Listbox.renderItems(Listbox.java:2891)
      	at org.zkoss.zul.Listbox.service(Listbox.java:3740)
      	at org.zkoss.zk.ui.impl.DesktopImpl.service(DesktopImpl.java:758)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1310)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:606)
      ...
      
      java.lang.NullPointerException
      	at org.zkoss.zul.Listbox$Renderer.render(Listbox.java:2754)
      	at org.zkoss.zul.Listbox.renderItems(Listbox.java:2891)
      	at org.zkoss.zul.Listbox.service(Listbox.java:3740)
      	at org.zkoss.zk.ui.impl.DesktopImpl.service(DesktopImpl.java:758)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1310)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:606)
      ...
      

      Expected Result

      stable scroll position
      no exceptions

      Debug Info

      related to ZK-3570 (ROD and renderAll are used in combination...)

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours
                6h