General Interface is an open source project hosted by the Dojo Foundation

Creating and Managing a Browser Window

General Interface provides the jsx3.gui.Window API to leverage the native browser window in distributing a General Interface application across multiple browser windows. The use of several windows is particularly useful when using multiple monitors. In addition, in some cases, a browser window is a better design choice than a dialog, because it's visually independent of the rest of the application.

The jsx3.gui.Window class, which allows rendering a branch of the General Interface DOM in a separate browser window, must be created and managed using the jsx3.app.Server class.

Server Class APIs

You can create and access instances of the Window class with these methods in the jsx3.app.Server class:

  • createAppWindow()
  • getAppWindow()
  • loadAppWindow()

For more information, see jsx3.app.Server in General Interface API Reference (Help > API Documentation).

createAppWindow() Method

The createAppWindow() method creates a new jsx3.gui.Window instance for the specified server and places the window in the General Interface DOM. Because the createAppWindow() method doesn't open the window, you must call the Window.open() method separately to open it. Depending on security settings and popup blockers, the open() method might not open a window. To determine if the window opened successfully, register for the Window.DID_OPEN event. For more information, see jsx3.gui.Window in General Interface API Reference.

getAppWindow() Method

The getAppWindow() method is a convenience method that returns a previously created jsx3.gui.Window by name.

loadAppWindow() Method

The loadAppWindow() method creates and loads a new jsx3.gui.Window instance from a component serialization file and places it in the General Interface DOM.

The component serialization file must have a Window object as the root object as shown in the following example. The window in the example has some of these properties:

  • object type jsx3.gui.Window
  • name myWindow
  • title bar title Hello World
  • content Hello World
    <?xml version="1.0" ?>
    <serialization xmlns="urn:tibco.com/v3.0">
      <object type="jsx3.gui.Window">
        <variants jsxdependent="1" jsxresizable="1" jsxscrollable="0"/>
        <strings jsxname="myWindow" jsxtitle="Hello World" jsxwidth="880"
           jsxheight="600"/>
          <object type="jsx3.gui.Block">
            <variants jsxoverflow="3" jsxrelativeposition="0" jsxleft="0" jsxtop="0"/>
            <strings jsxname="content" jsxwidth="100%" jsxheight="100%">
                 jsxtext="Hello World"/>
          </object>
      </object>
    </serialization>

General Interface Builder has two examples of browser windows that are loaded from serialization files:

  • API Help Choose Help > API Documentation > in separate window to open API help in an external browser window. If the API documentation is open in a dialog, you can also click the Move to External Browser Window button .
  • System Log palette Click the Docking Options button on the System Log palette toolbar and choose Window to open the system log in an external browser window.

Contents

Searching General Interface Docs

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.