First time here? Check out the FAQ!
Hi, Sometimes SpreadSheet is giving me this exception:
12-jun-2013 9:40:19 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1351
GRAVE: >>java.lang.NullPointerException
>> at org.zkoss.zss.ui.Spreadsheet$InnerDataListener.onFriendFocusMove(Spreadsheet.java:2126)
>> at org.zkoss.zss.ui.Spreadsheet$InnerDataListener.access$900(Spreadsheet.java:1952)
>> at org.zkoss.zss.ui.Spreadsheet$InnerDataListener$5.onEvent(Spreadsheet.java:1983)
>> at org.zkoss.zss.engine.event.EventDispatchListener.onEvent(EventDispatchListener.java:43)
>> at org.zkoss.zk.ui.event.impl.DesktopEventQueue$QueueListener.onEvent(DesktopEventQueue.java:145)
>> at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2734)
>> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2705)
>> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2646)
>> at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>> at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:534)
>> at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:461)
What's onFriendFocusMove and why it is causing a NullPointer???
Thank you!
EDIT: I'm using zss 2.5.0 I solved it in my application but I would like to know why it was happening. I have a page with some registers in a listbox and clicking a button the div of the listbox is made invisible and a div with a spreadsheet is made visible. When user go back to the view with the listbox I delte the spreadhseet clearing the children of its parent:
divContainingSpreadSheet.getChildren().clear()
and the divContainingSpreadSheet is made invisible and the listbox div visible. When the process is repeated and the spreadsheet is made visible again, the exception is thrown!
I solved it detaching all the children of the divContainingSpreadSheet. I go over all its children and I detach it one by one instead of using the clear().
Asked: 2013-06-12 08:46:29 +0800
Seen: 10 times
Last updated: Jun 14 '13
Some feedback about ZK SpreadSheet
Cannot add to Eclipse the ZK SPreadsheet jars
Zk Spreadsheet: Date in cells are displayed as GMT+0 while my locale is GMT+8
I want cancel the page part refresh ,how?
Spreadheet and pagination problem
Zk spreadsheet 2.0 beta3 - row copy/cut and paste not working
Zk spreadsheet - cell values changing automatically
how to make spreadsheet row un-editable & freeze???
What version of SpreadSheet and ZK ? Can you provide some case for reproducing?
paowang ( 2013-06-14 01:51:51 +0800 )editI edited the original post with an example
Neus ( 2013-06-14 07:49:58 +0800 )editThe onFriendFocusMove event will be triggered when you turn on the Collaboration Edit: http://books.zkoss.org/wiki/ZK%20Spreadsheet%20Essentials/Working%20with%20ZK%20Spreadsheet/Collaboration%20Edit#Result
I think that some operations enable this feature accidentally and cause this situation.
paowang ( 2013-06-19 09:03:00 +0800 )editI haven't turn the Collaboratio edit on consciously. In fact, since now I didn't know nothing about it. And do you know what operation enables it? Thank you
Neus ( 2013-06-19 15:25:21 +0800 )editAccording to that page, just set the book's share scope to APPLICATION scope. e.g: book.setShareScope(EventQueues.APPLICATION); This will turn on the Collaboration Edit.
paowang ( 2013-06-20 03:49:28 +0800 )edit