Finding Values and More with Web Page Dialog Boxes
In this conclusion to a five-part series, we'll wrap up our discussion of what you can do with web page dialog boxes. Among other things, we include some tips you'll need to keep in mind when you include web page dialog boxes in your commercial projects.
Finding Values and More with Web Page Dialog Boxes (Page 1 of 4 )
Accessing Value in a Descendant Window
if (window.name == name)
This function, like the one before it, is called by another function or event in the same window. The function receives the name of the descendant window that interests you as an argument. It first checks to see if the name it has received is the name of its window. If that is true, it determines the reference of the window it is in and returns it; otherwise, it forwards the request to the immediate child window, calling the same function there.
In order to call a function in the child window, it needs a reference to the child window. We have been opening child windows as follows:
childReference = window.open();
When the followOrReturn(name) function is in every page, it allows messages to be propagated from child to child. This enables you to get the reference of a descendant window, if you know the name of that descendant window. You can then use the reference in whatever ancestor window you are in, to access value in the descendant window.