'null' Is Null Or Not An Object (IE8, ZK 5.0.5)

asked 2014-10-16 16:16:11 +0800

salbader gravatar image salbader
15 5

updated 2014-10-16 16:18:13 +0800


when accessing a menu in a <tree>-Tag with <treeitem id="titem1" visible="false" value="pageUriName"> I got some problems with IE8. The bug doesn't appear in IE9, Firefox or other and is called >>Failed to process setAttr 'null' Is Null Or Not An Object<<.

In the developer tools, this is printed: Message: 'null' is null or not an object Line: 23 Char: 11118 Code: 0 URI: http://localhost:8080/appname/zkau/web/a057d87e/js/zk.wpd

Does anybody know that to do?

delete flag offensive retag edit


do you have a simple reproducing sample you can post on zkfiddle.org?

cor3000 ( 2014-10-20 07:34:53 +0800 )edit

Unfortunately it's quite complicated to isolate to "buggy treeitem", because all Composer to the corresponding zul-Pages use the same Composer and some work and some don't. Maybe I found a hint, but I don't know what to do with this:

salbader ( 2014-10-20 15:28:57 +0800 )edit

the missing url: http://stackoverflow.com/questions/14113196/zkoss-failed-to-process-setattr-cannot-call-method-set-of-null-typeerror

salbader ( 2014-10-20 15:30:09 +0800 )edit

1 Answer

Sort by » oldest newest most voted

answered 2014-10-21 01:33:55 +0800

cor3000 gravatar image cor3000
5364 2 7
ZK Team

updated 2014-10-21 01:35:32 +0800

first: you could try upgrading to a new ZK 5 version e.g. 5.0.11 (CE) or 5.0.13 (PE/EE) and check if the problem persists, it is likely that severe bugs are fixed in higher versions. (http://www.zkoss.org/download/zk click maintenance downloads)

second: the stackoverflow link you found gives you some basic ideas how to get started debugging a JS error, most important here is to enable debug-js in your zk.xml:


that will turn difficult to identify error locations like (char 11000 in line 23)

Line: 23 Char: 11118

into something like

Line: 5678 Char: 32 (just made up)

e.g. in chrome if you enable the developer tools (F12) before reproducing the error you'll get the JS call stack with all the method calls and positions that cause the issue.

You can even click the line number and directly see the code that's causing it.

Also check the last ajax response (/zkau request) and see which component was added, or changed last, this will help reducing the code to have an isolated example only focussing on the atomic operation causing the trouble.

Usually by removing anything that's not required to reproduce the issue, a case can be simplified down to something like that (http://tracker.zkoss.org/browse/ZK-2448)



link publish delete flag offensive edit


Thanks for your reply! I will examine the 2 hints and post some feedback.

salbader ( 2014-10-21 08:52:42 +0800 )edit

1) Update to 5.0.13 brings better Logging but nothing more, I didn't know: "Oct 21, 2014 11:46:31 AM org.zkoss.zk.ui.impl.DesktopImpl service:715 SEVERE: [Desktop z_bjm:/index.zul] client error: Failed to process setAttr 'null' is null or not an object (TypeError)"

salbader ( 2014-10-21 10:49:39 +0800 )edit

2) It turned out, that some GUI elements were manipulated during the DOM-Creation. This caused the unexpected behaviour... Additionally I've created an example in ZK-Fiddle, which didn't show that error, but this was helpfull to understand my fault. So thanks four your help!

salbader ( 2014-10-29 08:22:38 +0800 )edit

thanks for sharing your success, I am glad I could help

cor3000 ( 2014-10-29 09:17:23 +0800 )edit
Your answer
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

1 follower



Asked: 2014-10-16 16:16:11 +0800

Seen: 13 times

Last updated: Oct 21 '14

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