Class: DialogManagerClient

Dialog Manager Client

The Dialog Manager client simplifies interacting with dialog windows, by spawning them and getting data back from them. In this contex, a dialog window is simply a child window spawned to interact with the user, such as a confirmation dialog. Functions are provided here for both the parent-window side and the dialog/child-window side.

FSBL.Clients.DialogManager is always pre-initialized with one instance of the Dialog Manager in the Finsemble Library (making it essentially, a singleton when referenced in the same window). This means component developers directly access the Dialog Manager without using the constructor (e.g., FSBL.Clients.DialogManager.spawnDialog(...);) -- the constructor is not exposed to components.

Methods

getParametersFromInDialog
(dialogID){object}

clients/dialogManagerClient.js, line 124

Called within dialog window to get the parameters passed in spawnDialog's "inputParams"

Name Type Description
dialogID any

identifies dialog to be terminated

Returns:
Type Description
object inputParams parameters pass to dialog
Example
var dialogData = FSBL.Clients.DialogManager.getParametersFromInDialog();

respondAndExitFromInDialog
(responseParameters)

clients/dialogManagerClient.js, line 138

Called within dialog window to pass back dialog response and terminal window. This results in the spawnDialog callback function (i.e. dialogResponseCallback) being invoked with responseParameters passed in.

Name Type Description
responseParameters any

parameters returned to parent (i.e. window that spawned the dialog)

Example
FSBL.Clients.DialogManager.respondAndExitFromInDialog({ choice: response });

spawnDialog
(launchParams, inputParams, dialogResponseCallback, cb)

clients/dialogManagerClient.js, line 70

Spawns a Dialog window.

parameters pass here in inputParams can be retrieved in the dialog window by calling getParametersFromInDialog.

TODO
  • allow dialogs to be permanent components instead of ad-hoc.
  • support paramter to make the dialog modal
Name Type Description
launchParams object

Parameters. Same as LauncherClient#spawn with the following exceptions.

Name Type Description
url string

URL of dialog to launch

name string optional

The name of the dialog

x any

Same as LauncherClient#spawn except defaults to "center".

y any

Same as LauncherClient#spawn except defaults to "center".

inputParams any

Object or any data type needed by your dialog.

dialogResponseCallback function

called when response received back from dialog window (typically on dialog completion). responseParameters is defined by the dialog.

cb function optional

Returns response from LauncherClient#spawn

Example
FSBL.Clients.DialogManager.spawnDialog(
	{
		name: "dialogTemplate",
		height:300,
		width:400,
		url:"http://localhost/components/system/dialogs/dialog1.html"
	},
	{
		someData: 12345
	},
		function (error, responseParameters) {
			if (!error) {
				console.log(">>>> spawnDialog response: " + JSON.stringify(responseParameters));
			}
	});