Class idx.mobile.Login


Extends dojox.mobile.SimpleDialog.
The Login widget is a dialog enabling the user to log in to an IBM One UI application in a standard way. It extends dojox/mobile/SimpleDialog to perform initialisation and configuration.

To create the dialog, initialise the widget with the required properties. The appropriate HTML and CSS is created immediately, and subsidiary dijit components may be created and marshalled, but the dialog is initially hidden. When the dialog is to be shown, call the show() method. If the dialog includes a cancel button, this will automatically hide the dialog when selected. The application may also hide the dialog if required by calling the hide() method.

When the user has entered credentials and presses the "Log In" button, the "login" event is triggered. The application can connect to the "onLogin" method which receives an object containing two fields:

The application should use the supplied credentials to attempt to authenticate the user. If authentication is successful, the dialog can be dismissed by calling the hide() method. If authentication is not successful, the application can call the showMessage() method to display an explanatory message to the user and keep the dialog visible for them to retry. These responses do not need to be made synchronously: in some cases the application will need to send an asynchronous authentication request and then take the appropriate action when it responds.


Defined in: <idx\mobile\Login.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 
Creates a new "Login" dialog

Field Summary

Field Attributes Field Name and Description
 
If true, the dialog will include a cancel button enabling the user to abandon the login attempt.
 
The copyright year or years that should be inserted into the legal information.
 
legal 
The copyright or other legal information that should be displayed.
 
name 
The product name (required), to a maximum of 90 characters.

Method Summary

Method Attributes Method Name and Description
 
 
 
hide()
 
onLogin(args)
Handle the user pressing the "Log In" button.
 
 
showMessage(message)
Display a message to the user on the login panel.

Constructor Detail

idx.mobile.Login()

Creates a new "Login" dialog
var logindialog = new idx.mobile.Login({ name: "My product", onLogin: function(args){ this.hide(); } });

Field Detail

cancelable

If true, the dialog will include a cancel button enabling the user to abandon the login attempt. This is appropriate for applications where login is optional.

copyright

The copyright year or years that should be inserted into the legal information. This may be a single year number or a comma-separated list of year numbers. The default is '2012'.

{string} legal

The copyright or other legal information that should be displayed. This may include simple HTML mark-up (e.g. for special characters or emphasis). It may also include string substitutions, eg ${copyright}.

{string} name

The product name (required), to a maximum of 90 characters. This may include simple HTML mark-up (e.g. for special characters or emphasis).

Method Detail

buildRendering()


create()


hide()


onLogin(args)

Handle the user pressing the "Log In" button. The credentials that have been entered (name, password) are passed as properties of the supplied args object. The caller should connect to this method, apply the credentials that have been entered, and either hide the dialog (if login was successful) or show a message to inform the user of failure and invite them to retry.
Parameters:
args

postMixInProperties()


showMessage(message)

Display a message to the user on the login panel. For example, if the user attempts to log in and the credentials are rejected, this method can be called to display a suitable message to alert the user to the failure and invite them to retry. The message is cleared when the dialog is dismissed, or when this method is called again with a new message or with no parameters to remove the current message.
Parameters:
message