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

NPE when removing listmodel element

XMLWordPrintable

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

      Steps to Reproduce

      run the attached example rod-list-remove.zul
      scroll to the bottom of the listbox (ROD will load new items)
      remove the last item (or any other item after ROD loaded a new block of listitems)

      Actual Result

      java.lang.NullPointerException
      	at org.zkoss.zul.impl.ListboxDataLoader.syncModel0(ListboxDataLoader.java:351)
      	at org.zkoss.zul.impl.ListboxDataLoader.syncModel(ListboxDataLoader.java:300)
      	at org.zkoss.zkmax.zul.impl.LiveListboxDataLoader.syncModel(LiveListboxDataLoader.java:168)
      	at org.zkoss.zkmax.zul.impl.LiveListboxDataLoader.doLiveListDataChange(LiveListboxDataLoader.java:130)
      	at org.zkoss.zkmax.zul.impl.LiveListboxDataLoader.doListDataChange(LiveListboxDataLoader.java:98)
      	at org.zkoss.zul.Listbox.onListDataChange(Listbox.java:2591)
      	at org.zkoss.zul.Listbox.access$1000(Listbox.java:270)
      	at org.zkoss.zul.Listbox$4.onChange(Listbox.java:481)
      	at org.zkoss.zul.AbstractListModel.fireEvent(AbstractListModel.java:59)
      	at org.zkoss.zul.ListModelList.remove(ListModelList.java:319)
      	at org.zkoss.zul.ListModelList.remove(ListModelList.java:326)
      
      

      Expected Result

      remove the item without exception

      Debug Info

      The combination of org.zkoss.zul.listbox.rod="true" and calling renderAll() after setting the model causes this error.

      Workaround

      When using ROD don't call renderAll() or disable ROD (org.zkoss.zul.listbox.rod="false") for this listbox

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

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 2 hours, 30 minutes
                1d 2h 30m