Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
root.children is null or not an object
System
I haven't figured out the pattern exactly, but sometimes when I create a new DCR or open an existing one I get the error root.children is null or not an object. The DCTs have a lot of FormAPI, but it doesn't look like it's custom code accessing this variable - it looks like an anonymous function (source not visible) calls refreshTree() which calls refreshNodes (in datacapture_nav_tree.html), which accesses root.children. I think there may be some issue with callServer - my CGI is trying to repopulate drop-downs, etc. while Interwoven is trying to refresh the page and there is some kind of conflict. I have found a way to avoid callServer in most cases but in this case I can't. Is there a fix for this? The problem is that once JavaScript crashes on this bug, the resf of my FormAPI does not execute. Other times when I open the DCT I get no error and the form works fine, so I am assuming it's the good ol' async callServer interacting with what is otherwise assumed to be a synchronous environment.
Solaris iwserver: 5.5.2 Build 17976 Interwoven 20030323.
Find more posts tagged with
Comments
Migrateduser
If I had to guess, I would guess that this is a timing issue; you're probably trying to access a form item in FormAPI before the form as completely loaded. In FP6, this was addressed by the introduction of the onFormLoad event. However, in TST5.x, there is no such mechanism.
A quick fix would be to delay your callServer() call for an arbitrary amount of time (ideally, the amount of time needed to complete the form load and draw.) For example, putting the callServer() call within a setTimeout() calling it, say, 1 second in the future. You may have to play around with it to find a good number.
--Daniel
Migrateduser
I agree that this is probably the bug I'm hitting, but I think more specifically it is that a callServer I am invoking to generate JavaScript is trying to interact with the form while a redraw() (called after callServer) is refreshing the form.