pureweb.client. MultiWindow

PureWeb Multi-Window class. Enables a PureWeb client to add a second browser window to the PureWeb session. This code is used by both parent and child windows.

Method Summary

canCreateNewWindow
Returns true if this client can open a new window (in other words, if the client passes guards of createNewWindow).
closeChildWindows
Closes all multi window child windows of this web client
createNewWindow
Creates a new window to attach to this PureWeb client.
getOpenWindows
Returns all windows known by this parent window.
getPendingChildren
Returns the expiring storage object for this multi-window instance
isChildWindow
Returns a Boolean value that indicates whether this window is a child of the parent browser window in this multi-window session.
isMultiWindow
Returns a Boolean value that indicates whether this window is participating in a multi-window session.
isMultiWindowFlowControl
Returns a Boolean value that indicates whether this window is sending flow control messages.
isParentWindow
Returns a Boolean value that indicates whether this window is Parent incoming messages to other browser windows in this multi-window session.
sendMultiWindowMessage
Sends a string from one window to one or all windows
setIsChildWindow
Sets a Boolean value that indicates whether this window should consume incoming messages from a parent window in this multi-window session.
setIsMultiWindowFlowControl
Sets a Boolean value that indicates whether this window is sending flow control messages.
setIsParentWindow
Sets a Boolean value that indicates whether this window should broadcast incoming messages to other browser windows in a multi-window session.

Constructor

new MultiWindow(webclient)

Parameters:
Name Type Description
webclient pureweb.client.WebClient The webclient.
Throws:
pureweb.IllegalArgumentException

Extends

  • pureweb.events.EventTarget

Members

<static> EventType → string

Types of events the MultiWindow class fires.
Properties:
Name Type Default Description
MULTI_WINDOW_MESSAGE string Event dispatched when an interwindow message has been receieved
CHILD_WINDOW_CLOSED string Event dispatched by a parent when one of its children has been closed

<protected> logger → goog.debug.Logger

Define logger.

pendingChildren_ → Object

Method Detail

canCreateNewWindow() → {boolean}

Returns true if this client can open a new window (in other words, if the client passes guards of createNewWindow). Returns false otherwise. This is essentially a pre-test for any conditions in createNewWindow that might throw.

closeChildWindows()

Closes all multi window child windows of this web client

createNewWindow(specs, passFlowControl) → {string|null}

Creates a new window to attach to this PureWeb client. The child window will be treated as an extension of the parent window and will piggy-back on the parent window's communication channel. Terminating the parent window will terminate all child windows.
Parameters:
Name Type Argument Description
specs string <optional>
A comma seperated list of window specifications (see window.openWindow).
passFlowControl boolean <optional>
A boolean indicating whether flow control should be driven by the new window. This is helpful for IE 11, as it reduces frame lag.
Returns: The name of the window created.

getOpenWindows() → {Array}

Returns all windows known by this parent window. If not the parent window, the child will call its parent to perform the action

The order of windows in the resultant array will be the order in which the windows were created by the parent window. The first element of the array is the parent window.

getPendingChildren() → {Object}

Returns the expiring storage object for this multi-window instance

isChildWindow() → {boolean}

Returns a Boolean value that indicates whether this window is a child of the parent browser window in this multi-window session. Will return true if it is, or false otherwise. Child WebClient instances receive messages via window.onmessage.

isMultiWindow() → {boolean}

Returns a Boolean value that indicates whether this window is participating in a multi-window session. Either as a child or as a parent. Will return true if it is, or false otherwise. Child WebClient instances receive messages via window.onmessage.

isMultiWindowFlowControl() → {boolean}

Returns a Boolean value that indicates whether this window is sending flow control messages. Will return true if it is, or false otherwise.

isParentWindow() → {boolean}

Returns a Boolean value that indicates whether this window is Parent incoming messages to other browser windows in this multi-window session. Will return true if it is, or false otherwise.

sendMultiWindowMessage(message, dest)

Sends a string from one window to one or all windows
Parameters:
Name Type Description
message string Content to send to other window(s)
dest string Optional destination window by Window.name

setIsChildWindow(child)

Sets a Boolean value that indicates whether this window should consume incoming messages from a parent window in this multi-window session. Set to true to make this a child window, or to false otherwise.
Parameters:
Name Type Description
child boolean The value to set.

setIsMultiWindowFlowControl(flow)

Sets a Boolean value that indicates whether this window is sending flow control messages. Set to true to that flow control messages will be sent, or to false otherwise.
Parameters:
Name Type Description
flow boolean The value to set.

setIsParentWindow(parent)

Sets a Boolean value that indicates whether this window should broadcast incoming messages to other browser windows in a multi-window session. Set to true to make this a parent window, or to false otherwise.
Parameters:
Name Type Description
parent boolean The brodcasting value to set.