0

NullPointer onFriendFocusMove

asked 2013-06-12 08:46:29 +0800

Neus gravatar image Neus
1415 14

updated 2013-06-14 07:49:32 +0800

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().

delete flag offensive retag edit

Comments

What version of SpreadSheet and ZK ? Can you provide some case for reproducing?

paowang ( 2013-06-14 01:51:51 +0800 )edit

I edited the original post with an example

Neus ( 2013-06-14 07:49:58 +0800 )edit

The 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 )edit

I 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 )edit

According 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
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-06-12 08:46:29 +0800

Seen: 10 times

Last updated: Jun 14 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More