| Package | qnx.dialog |
| Class | public final class PopupList |
| Inheritance | PopupList BaseDialog flash.events.EventDispatcher |
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.
| Property | Defined By | ||
|---|---|---|---|
![]() | align : String [write-only]
Sets the position of the dialog. | BaseDialog | |
![]() | defaultButtonIndex : int
Gets or sets the default button index value. | BaseDialog | |
![]() | dialogSize : 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 | ||
![]() | hideOnButtonClick : Boolean
Gets or sets the a value that determines if the dialog will close
when the user clicks a button. | BaseDialog | |
![]() | hideOnOutsideClick : 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 | |
![]() | id : 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 | ||
![]() | modalAlpha : 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 | ||
![]() | selectedIndex : 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 | ||
![]() | title : String [write-only]
Sets the text for the dialog's title. | BaseDialog | |
![]() | titleHtml : String [write-only]
Sets the html text for the dialog's title. | BaseDialog | |
| Method | Defined By | ||
|---|---|---|---|
Constructor for the PopupList class. | PopupList | ||
![]() | addButton(label:String):int
Adds a button to the dialog. | BaseDialog | |
![]() | cancel():void
Cancels or hides the dialog. | BaseDialog | |
![]() | getButtonCount():int
Return the button count from the button array. | BaseDialog | |
![]() | getButtonPropertyAt(prop:String, index:int):Object
Gets the value of a property, given the property name and property object index. | BaseDialog | |
![]() | getItemAt(index:int):Object
Returns the button at the given index. | BaseDialog | |
![]() | removeButtonAt(index:int):void
Removes a button from the dialog, given an index. | BaseDialog | |
![]() | sendDescription():Object
Gathers up and returns the description object for the dialog (client side). | BaseDialog | |
![]() | 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 | |
![]() | show(groupId:String = null):void
Shows the dialog on the screen as a system or application dialog. | BaseDialog | |
![]() | update():void
Updates the dialog to reflect its current attributes. | BaseDialog | |
| disabledIndices | property |
disabledIndices:ArrayGets or sets the disabled indices in the list.
public function get disabledIndices():Array public function set disabledIndices(value:Array):void| headerIndices | property |
headerIndices:ArrayGets 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:
public function get headerIndices():Array public function set headerIndices(value:Array):void| items | property |
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'];
public function set items(value:Array):void| multiSelect | property |
multiSelect:Boolean [write-only]
Sets a Boolean that allows multiple item selection in the list.
public function set multiSelect(value:Boolean):void| scrollToIndex | property |
scrollToIndex:intGets or sets the index in the list to scroll to.
public function get scrollToIndex():int public function set scrollToIndex(value:int):void| selectedIndices | property |
selectedIndices:ArrayGets or sets the selected item index array.
public function get selectedIndices():Array public function set selectedIndices(value:Array):void| separatorIndices | property |
separatorIndices:ArrayGets 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:
public function get separatorIndices():Array public function set separatorIndices(value:Array):void| PopupList | () | Constructor |
public function PopupList()
Constructor for the PopupList class.
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.