Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-1284

Row insertion during initialization causes NPE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Normal
    • 3.9.1
    • 3.9.0
    • ZSS Component
    • Security Level: Jean

    Description

      Steps to Reproduce

      run the attached example

      Actual Result

      The blank sheet is initially loaded and dynamically filled.
      2 Rows are inserted
      NPE occurs

      Oct 05, 2016 2:11:12 PM org.zkoss.zk.ui.impl.UiEngineImpl handleError
      SEVERE: 
      java.lang.NullPointerException
      	at org.zkoss.zss.ui.Spreadsheet$ExtraCtrl.insertRows(Spreadsheet.java:3970)
      	at org.zkoss.zss.ui.Spreadsheet$InnerModelEventDispatcher.onRowColumnInsertDelete(Spreadsheet.java:2697)
      	at org.zkoss.zss.ui.Spreadsheet$InnerModelEventDispatcher.access$1700(Spreadsheet.java:2321)
      	at org.zkoss.zss.ui.Spreadsheet$InnerModelEventDispatcher$11.onEvent(Spreadsheet.java:2390)
      	at org.zkoss.zss.ui.ModelEventDispatcher.onEvent(ModelEventDispatcher.java:49)
      	at org.zkoss.zss.model.impl.EventQueueListenerAdaptor$WrappedListener.onEvent(EventQueueListenerAdaptor.java:107)
      	at org.zkoss.zk.ui.event.impl.DesktopEventQueue$QueueListener.onEvent(DesktopEventQueue.java:168)
      	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3163)
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3133)
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3075)
      	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1853)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1625)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:548)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:369)
      	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:211)
      	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:137)
      ...
      

      Expected Result

      no exception

      Debug Info

      This does not happen during an Ajax update
      And the problem does not happen when inserting just 2 cells instead of whole rows.

      Workaround

      Access the internal sheet and add the rows directly bypassing the Range API

      sheet1.getInternalSheet().insertRow(2, 3);
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: