LoginDialog

You can use tm1web/api/session/LoginDialog to display or destroy a login dialog box.

Example

var dialog = new LoginDialog({
    onLogin: function(sessionInfo) {
        console.log(sessionInfo);
    },
    tm1Server: "Planning Sample",
    adminHost: "localhost"
});

dialog.show();

Construction

The LoginDialog module accepts several parameters for construction.

onLogin
Type: Function
Callback when login succeeds. An object that contains session information is passed as a parameter to the function on execution.

An example of this object is:

{
	tm1SessionId : "JcFxniSEzsJZVlQQhYDLDQ",
	sessionToken : "baa4ff9a-ddfb-41d1-9c71-f0add92325fd",
	adminHost : "localhost",
	tm1Server : "Planning Sample",
	username : "Admin"
}

This object has the same format as the response from the login method of tm1web/api/session/session.

adminHost
Type: String (optional)
Default value: localhost
The admin host from which to retrieve the TM1 server list. If no admin host parameter is specified, the AdminHost parameter value in the tm1web_config.xml file is used if it is specified.
tm1Server
Type: String (optional)
The TM1 server to log in to.
adminHostVisible
Type: Boolean (optional)
Default value: true
If false, the admin host text box is hidden from the login dialog.
tm1ServersVisible
Type: Boolean (optional)
Default value: true
If false, the list of TM1 servers are hidden from the login dialog

The adminHost, tm1Server, adminHostVisible, and tm1ServersVisible properties can be configured with the set method.

For example:

loginDialog.set("adminHost", "Planning Sample");

Methods

show()
Displays the login dialog box.
destroy()
Destroys the login dialog box.

For more information, see Dojo documentation for dijit._WidgetBase (https://dojotoolkit.org/reference-guide/1.10/dijit/_WidgetBase.html).