url: Path to the main HTML file for the child Window. This HTML file will behave almost identically to the main application HTML, except it (and associated scripts) are loaded in the child window.
xPos: Left position of the child window relative to the current desktop.
yPos: Top position of the child window, relative to the current desktop.
width: Initial width of the child window.
height: Initial height of the child window.
callback: Bound JS callback, called when the documentComplete event fires on the child window.
Returns:
IdWindow: Id of Window.
INVALID/ERROR: If invalid arguments are passed, or an error occurs.
Notes:
This function MUST be called only from the main application window. Calling from another child window will result in an error.
For smoothness of operation, we recommend calling with the SW_HIDE argument, and having the window's own script invoking showWindow(true) when fully loaded and initialized.
Do not call callChildWindow until the callback success has been received, or a runtime error will result.
For added protection, particularly when loading many scripts, have the child call a custom function on the parent when it becomes visible -- and only make calls from the parent to the child after this.
The callback function fires when the window is first created, and when the window is closed. The evt object has the following properties:
evt.func: The internal function name ("create" when the window is first loaded, "close" immediately before the child window closes.
evt.wndId: The Id of the child window from which the event was raised.
The child window can call almost all of functions that a main window will call, but there are some exceptions.
It cannot create other child windows.
closeApp will only close the child window, not the application.
Calls to functions in plugins cannot be made directly.
If the main application window is closed, all child windows will be closed automatically and the process will terminate.
wbc.callChildWindow
Description: Call a JS function in a child (or main) window.
idWindow: The ID of the child window. Pass zero to call the main application window.
funcName: The name of the function to call.
arg1, arg2, arg3, arg4. Optional arguments. Any type. 0-4 arguments can be passed to the function. To pass more, pass a simple object or array of primitive types. Objects/arrays with non-primitive types should not be passed.
Returns:
Return value (including null), "ERROR" or "INVALID".
Notes:
The function is used to communication between the main window and the child windows.
The function is similar to the execWnd, except that it calls some existing JS function instead of executing some free JS code.
The function can be called by the main WBC window to execute some JS function in the context of some child window, but also the function can be called by the child window to execute some JS function in the context of the main WBC window. In order to call the main WBC window there is the need to specify 0 value as the wndId parameter.
wbc.closeChildWindow
Description: Closes the Child Window.
Threading: Foreground/Immediate
Function: wbc.closeChildWindow(idWindow)
Arguments:
idWindow: The ID of the child window to be closed. Zero is not allowed.