qnx.dialog.PopupList

PopupList

Properties | Methods | Events | Examples


Packageqnx.dialog
Classpublic final class PopupList
InheritancePopupList Inheritance BaseDialog Inheritance flash.events.EventDispatcher

The PopupList class encapsulates the properties of a dropdown or popup list class within a dialog. The list is used to display a set of choices and to allow the user to select options from the list.

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
  disabledIndices : Array
Gets or sets the disabled indices in the list.
PopupList
  headerIndices : Array
Gets or sets the header indicies for the list.
PopupList
 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
  items : Array
[write-only] Sets the list item array.
PopupList
 InheritedleaveFocus : Boolean
[write-only] Sets the leaveFocus property for the dialog.
BaseDialog
 InheritedmodalAlpha : Number
[write-only] Sets the background alpha value.
BaseDialog
  multiSelect : Boolean
[write-only] Sets a Boolean that allows multiple item selection in the list.
PopupList
  scrollToIndex : int
Gets or sets the index in the list to scroll to.
PopupList
 InheritedselectedIndex : int
[read-only] Returns the selected index of the button (that was clicked).
BaseDialog
  selectedIndices : Array
Gets or sets the selected item index array.
PopupList
  separatorIndices : Array
Gets or sets the separator indicies in the list.
PopupList
 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

Public Methods

 MethodDefined By
  
Constructor for the PopupList class.
PopupList
 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

disabledIndices


disabledIndices:Array

Gets or sets the disabled indices in the list.


Implementation

public function get disabledIndices():Array
public function set disabledIndices(value:Array):void

headerIndices


headerIndices:Array

Gets or sets the header indicies for the list.

You can use this method to create a header for the popup list. You can pass an Array of index values into the headerIndices() function to define which list cell labels will appear in bold. In the following listing, a header is applied to the first index in the list.

            var popUp:PopupList;
            popUp = new PopupList();
            popUp.title = "Wireless Networks";
            popUp.headerIndices = ['0'];
            popUp.items = ['Network name', 'Home',  'work', 'g-band', 'Cottage', 'patio'];
            popUp.addButton("OK");
            popUp.addButton("Test");
            popUp.addButton("Cancel");
            popUp.dialogSize= DialogSize.SIZE_MEDIUM;
            popUp.addEventListener(Event.SELECT, dButtonClicked); 
            popUp.show(IowWindow.getAirWindow().group);      
         

The code listing above creates the following dialog:


Implementation

public function get headerIndices():Array
public function set headerIndices(value:Array):void

items


items:Array  [write-only]

Sets the list item array. The list item array provides a list of choices for the user.

The items method takes an Array of Strings:

         popUp.items = ['Home', 'Work', 'Cottage', 'School'];
         


Implementation

public function set items(value:Array):void

multiSelect


multiSelect:Boolean  [write-only]

Sets a Boolean that allows multiple item selection in the list.


Implementation

public function set multiSelect(value:Boolean):void

scrollToIndex


scrollToIndex:int

Gets or sets the index in the list to scroll to.


Implementation

public function get scrollToIndex():int
public function set scrollToIndex(value:int):void

selectedIndices


selectedIndices:Array

Gets or sets the selected item index array.


Implementation

public function get selectedIndices():Array
public function set selectedIndices(value:Array):void

separatorIndices


separatorIndices:Array

Gets or sets the separator indicies in the list.

You can use this method to create separator cells within the popup list. You can pass an Array of index values into the separatorIndices() function to define which list cell labels will appear shaded. In the following listing, separator cells are added to the popup list in order to separate wireless networks by location.

            var popUp:PopupList;
            popUp = new PopupList();
            popUp.title = "Wireless Networks";
            popUp.headerIndices = ['0'];
            popUp.separatorIndices = ['1', '4'];
            popUp.items = ['Network name', 'Home',  'work', 'g-band', 'Cottage', 'patio'];
            popUp.addButton("OK");
            popUp.addButton("Test");
            popUp.addButton("Cancel");
            popUp.dialogSize= DialogSize.SIZE_MEDIUM;
            popUp.addEventListener(Event.SELECT, dButtonClicked); 
            popUp.show(IowWindow.getAirWindow().group);       
         

The code listing above creates the following dialog:


Implementation

public function get separatorIndices():Array
public function set separatorIndices(value:Array):void

Constructor Detail

PopupList()


public function PopupList()

Constructor for the PopupList class.

Examples

The following listing shows a dialog with a PopupList. The dialog allows a user to select a wireless network SSID from a group of available networks:

      private function showPopup():void
      {
        popUp = new PopupList();
        popUp.title = "Wireless Networks";
        popUp.items = ['Home', 'Work', 'Cottage', 'School'];
        popUp.addButton("OK");
        popUp.addButton("Cancel");
        popUp.dialogSize= DialogSize.SIZE_MEDIUM;
        popUp.addEventListener(Event.SELECT, dButtonClicked); 
        popUp.show(IowWindow.getAirWindow().group);            
      } 
     

The code snippet above produces the following dialog:

You can use the selectedIndices method to specify an array of indices. The indices will appear as selected when the dialog is loaded. The multiSelect property enables the user to select multiple list items at once.

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.