Customizer's Guide > Working with XUI (XML-based User Interface) Dialog Boxes > Identifying the Parent Window of a Dialog Box
  
Identifying the Parent Window of a Dialog Box
The methods Application.createDialogFromFile() and Application.createDialogFromDocument() each take a parameter, parent, for specifying the parent window of the dialog box. If the parent is not specified, the default parent is the current active window.
The parent parameter is useful when a user creates a dockable dialog box in a document type startup file or a document startup file. At the time these startup files are executed, the active document is the document to be brought up, and the edit window for the document is not yet displayed.
Users can get the new edit window from the active document and assign the correct parent to the new dockable dialog box as follows:
var parent = Application.activeDocument.defaultView.window;
var window = Application.createDialogFromFile('my.xml',null,parent);
window.dock = window.DOCK_LEFT;
window.show();