qnx.dialog.LoginDialog

LoginDialog

Properties | Methods | Events | Examples


Packageqnx.dialog
Classpublic final class LoginDialog
InheritanceLoginDialog Inheritance BaseDialog Inheritance flash.events.EventDispatcher

The LoginDialog class encapsulates the properties of a login dialog. The login dialog is used to provide password and identification functionality for the device.

Class information:
PlayBook Tablet OS Version:   1.0.6

View the examples



Public Properties

 PropertyDefined By
 Inheritedalign : String
[write-only] Sets the position of the dialog.
BaseDialog
 InheriteddefaultButtonIndex : int
Gets or sets the default button index value.
BaseDialog
 InheriteddialogSize : String
Gets or sets the size of the dialog.
BaseDialog
 InheritedhideOnButtonClick : Boolean
Gets or sets the a value that determines if the dialog will close when the user clicks a button.
BaseDialog
 InheritedhideOnOutsideClick : Boolean
Gets or sets the a value that determines if the dialog will close when the user clicks outside the dialog ( perhaps on the modal ).
BaseDialog
 Inheritedid : String
The ID of the dialog, where each ID is unique to the client owner.
BaseDialog
 InheritedleaveFocus : Boolean
[write-only] Sets the leaveFocus property for the dialog.
BaseDialog
  message : String
[write-only] Sets the value of the message field.
LoginDialog
  messageHtml : String
[write-only] Sets the message TextField's html value.
LoginDialog
 InheritedmodalAlpha : Number
[write-only] Sets the background alpha value.
BaseDialog
  password : String
Gets and sets the password entered by the user.
LoginDialog
  passwordLabel : String
[write-only] Sets the password label for the dialog.
LoginDialog
  passwordPrompt : String
[write-only] Sets the password placeholder text for the user.
LoginDialog
  rememberMe : Boolean
Gets or sets a value that determines the user's preference for remembering login credentials.
LoginDialog
  rememberMeLabel : String
[write-only] Sets the remember me label for the dialog checkbox.
LoginDialog
 InheritedselectedIndex : int
[read-only] Returns the selected index of the button (that was clicked).
BaseDialog
  showPasswordLabel : String
[write-only]
LoginDialog
 Inheritedtitle : String
[write-only] Sets the text for the dialog's title.
BaseDialog
 InheritedtitleHtml : String
[write-only] Sets the html text for the dialog's title.
BaseDialog
  username : String
Gets and sets the username entered by the user.
LoginDialog
  usernameLabel : String
[write-only] Sets the user name label for the dialog.
LoginDialog
  usernamePrompt : String
[write-only] Sets the user name placeholder text for the dialog.
LoginDialog

Public Methods

 MethodDefined By
  
Constructor for the LoginDialog class.
LoginDialog
 Inherited
addButton(label:String):int
Adds a button to the dialog.
BaseDialog
 Inherited
cancel():void
Cancels or hides the dialog.
BaseDialog
 Inherited
Return the button count from the button array.
BaseDialog
 Inherited
getButtonPropertyAt(prop:String, index:int):Object
Gets the value of a property, given the property name and property object index.
BaseDialog
 Inherited
getItemAt(index:int):Object
Returns the button at the given index.
BaseDialog
 Inherited
removeButtonAt(index:int):void
Removes a button from the dialog, given an index.
BaseDialog
 Inherited
Gathers up and returns the description object for the dialog (client side).
BaseDialog
 Inherited
setButtonPropertyAt(prop:String, value:Object, index:int):void
Sets a button property given a property name, a property value, and the index of a button property object.
BaseDialog
 Inherited
show(groupId:String = null):void
Shows the dialog on the screen as a system or application dialog.
BaseDialog
 Inherited
update():void
Updates the dialog to reflect its current attributes.
BaseDialog

Events

 Event Summary Defined By
 InheritedDispatched when a button in the dialog has been clicked.BaseDialog

Property Detail

message


message:String  [write-only]

Sets the value of the message field.


Implementation

public function set message(value:String):void

See also

messageHtml()

messageHtml


messageHtml:String  [write-only]

Sets the message TextField's html value.

In addition to providing HTML formatting to message text, the messageHtml method can be used to place images from the web within the message body of a dialog. In the following listing, an external image is placed in the body of a dialog and scaled using the width and height attributes.

         var dialog:LoginDialog = new LoginDialog();
         dialog.messageHtml = "<img src='http://www.somewebsite.com/somegraphic.jpg'" +
                     "width='500' height='350'/>";
         


Implementation

public function set messageHtml(value:String):void

password


password:String

Gets and sets the password entered by the user.


Implementation

public function get password():String
public function set password(value:String):void

passwordLabel


passwordLabel:String  [write-only]

Sets the password label for the dialog. If null, the password field is not shown.


Implementation

public function set passwordLabel(value:String):void

passwordPrompt


passwordPrompt:String  [write-only]

Sets the password placeholder text for the user.


Implementation

public function set passwordPrompt(value:String):void

rememberMe


rememberMe:Boolean

Gets or sets a value that determines the user's preference for remembering login credentials.


Implementation

public function get rememberMe():Boolean
public function set rememberMe(value:Boolean):void

rememberMeLabel


rememberMeLabel:String  [write-only]

Sets the remember me label for the dialog checkbox. If null, the remember me check box is not shown.


Implementation

public function set rememberMeLabel(value:String):void

showPasswordLabel


showPasswordLabel:String  [write-only]


Implementation

public function set showPasswordLabel(value:String):void

username


username:String

Gets and sets the username entered by the user.


Implementation

public function get username():String
public function set username(value:String):void

usernameLabel


usernameLabel:String  [write-only]

Sets the user name label for the dialog. If null, the user name field is not shown.


Implementation

public function set usernameLabel(value:String):void

usernamePrompt


usernamePrompt:String  [write-only]

Sets the user name placeholder text for the dialog.


Implementation

public function set usernamePrompt(value:String):void

Constructor Detail

LoginDialog()


public function LoginDialog()

Constructor for the LoginDialog class.

Examples

The following code listing sets up a login dialog with two buttons, a title, and a message:

        private function showLoginDialog():void
        {
            login = new LoginDialog();
            login.title = "Device is locked";
            login.message = "Please enter your username and password:";
            login.addButton("OK");
            login.addButton("Cancel");            
            login.passwordPrompt = "password";
            login.rememberMeLabel = 'Remember me';
            login.rememberMe = true;
            login.dialogSize= DialogSize.SIZE_SMALL;
            login.addEventListener(Event.SELECT, dButtonClicked); 
            login.show(IowWindow.getAirWindow().group);
        }
        

The code above produces the following dialog:

The passwordPrompt and usernamePrompt properties allow you to add placeholder text to the password and username fields. A user can click the rememberMe checkbox to store user login information.

Note: In the last line of the code snippet above, the window group ID is passed into the show method:
     .show(IowWindow.getAirWindow().group);
     
This ensures that the dialog will be modal for only this application. In other words, the application can still be minimized when this dialog is active.