Package | flexlib.baseClasses |
Class | public class PopUpMenuButtonBase |
Inheritance | PopUpMenuButtonBase ![]() |
Subclasses | ScrollablePopUpMenuButton |
See also
Property | Defined By | ||
---|---|---|---|
dataDescriptor : IMenuDataDescriptor
The data descriptor accesses and manipulates data in the data provider. | PopUpMenuButtonBase | ||
dataProvider : Object
DataProvider for popUpMenu. | PopUpMenuButtonBase | ||
iconField : String
Name of the field in the dataProvider Array that contains the icon to
show for each menu item. | PopUpMenuButtonBase | ||
iconFunction : Function
A function that determines the icon to display for each menu item. | PopUpMenuButtonBase | ||
labelField : String
Name of the field in the dataProvider Array that contains the text to
show for each menu item. | PopUpMenuButtonBase | ||
labelFunction : Function
A function that determines the text to display for each menu item. | PopUpMenuButtonBase | ||
popUp : IUIComponent [override] [write-only]
A reference to the pop-up Menu object. | PopUpMenuButtonBase | ||
showRoot : Boolean
Specifies whether to display the top-level node or nodes of the data provider. | PopUpMenuButtonBase |
Method | Defined By | ||
---|---|---|---|
Constructor. | PopUpMenuButtonBase |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when a user selects an item from the pop-up menu. | PopUpMenuButtonBase |
dataDescriptor | property |
dataDescriptor:IMenuDataDescriptor
The data descriptor accesses and manipulates data in the data provider. <p>When you specify this property as an attribute in MXML, you must use a reference to the data descriptor, not the string name of the descriptor. Use the following format for the property:</p> <pre><mx:PopUpMenuButton id="menubar" dataDescriptor="{new MyCustomDataDescriptor()}"/></pre> <p>Alternatively, you can specify the property in MXML as a nested subtag, as the following example shows:</p> <pre><mx:PopUpMenuButton> <mx:dataDescriptor> <myCustomDataDescriptor> </mx:dataDescriptor> ...</pre> <p>The default value is an internal instance of the DefaultDataDescriptor class.</p>
public function get dataDescriptor():IMenuDataDescriptor
public function set dataDescriptor(value:IMenuDataDescriptor):void
dataProvider | property |
dataProvider:Object
DataProvider for popUpMenu.
The default value is null
.
This property can be used as the source for data binding.
public function get dataProvider():Object
public function set dataProvider(value:Object):void
iconField | property |
iconField:String
Name of the field in the <codeph>dataProvider</codeph> Array that contains the icon to show for each menu item. The <codeph>iconFunction</codeph> property, if set, overrides this property. <p>The renderers will look in the data provider object for a property of the name supplied as the iconField. If the value of the property is a Class, it will instantiate that class and expect it to be an instance of an IFlexDisplayObject. If the value of the property is a String, it will look to see if a Class exists with that name in the application, and if it can't find one, it will also look for a property on the document with that name and expect that property to map to a Class.</p> If the data provider is an E4X XML object, you must set this property explicitly; for example, use @icon to specify the <codeph>icon</codeph> attribute.
The default value is "icon"
.
This property can be used as the source for data binding.
public function get iconField():String
public function set iconField(value:String):void
iconFunction | property |
iconFunction:Function
A function that determines the icon to display for each menu item. If you omit this property, Flex uses the contents of the field or attribute determined by the <codeph>iconField</codeph> property. If you specify this property, Flex ignores any <codeph>iconField</codeph> property value. By default the menu does not try to display icons with the text in the rows. However, by specifying an icon function, you can specify a Class for a graphic that will be created and displayed as an icon in the row. <p>The iconFunction takes a single argument which is the item in the data provider and returns a Class.</p> <blockquote> <codeph>iconFunction(item:Object):Class</codeph> </blockquote>
The default value is null
.
public function get iconFunction():Function
public function set iconFunction(value:Function):void
labelField | property |
labelField:String
Name of the field in the <codeph>dataProvider</codeph> Array that contains the text to show for each menu item. The <codeph>labelFunction</codeph> property, if set, overrides this property. If the data provider is an Array of Strings, Flex uses each String value as the label. If the data provider is an E4X XML object, you must set this property explicitly; for example, use @label to specify the <codeph>label</codeph> attribute.
The default value is "label"
.
This property can be used as the source for data binding.
public function get labelField():String
public function set labelField(value:String):void
labelFunction | property |
labelFunction:Function
A function that determines the text to display for each menu item. If you omit this property, Flex uses the contents of the field or attribute determined by the <codeph>labelField</codeph> property. If you specify this property, Flex ignores any <codeph>labelField</codeph> property value. <p>If you specify this property, the label function must find the appropriate field or fields and return a displayable string. The <codeph>labelFunction</codeph> property is good for handling formatting and localization.</p> <p>The label function must take a single argument which is the item in the dataProvider and return a String.</p> <blockquote> <codeph>labelFunction(item:Object):String</codeph> </blockquote>
The default value is null
.
public function get labelFunction():Function
public function set labelFunction(value:Function):void
popUp | property |
popUp:IUIComponent
[write-only] [override] A reference to the pop-up Menu object. <p>This property is read-only, and setting it has no effect. Set the <codeph>dataProvider</codeph> property, instead. (The write-only indicator appears in the syntax summary because the property in the superclass is read-write and this class overrides the setter with an empty implementation.)</p>
public function set popUp(value:IUIComponent):void
showRoot | property |
showRoot:Boolean
Specifies whether to display the top-level node or nodes of the data provider. If this is set to <codeph>false</codeph>, the control displays only descendants of the first top-level node. Any other top-level nodes are ignored. You normally set this property to <codeph>false</codeph> for E4X format XML data providers, where the top-level node is the document object.
The default value is true
.
public function get showRoot():Boolean
public function set showRoot(value:Boolean):void
PopUpMenuButtonBase | () | Constructor |
public function PopUpMenuButtonBase()
Constructor.
itemClick | Event |
mx.events.MenuEvent
mx.events.MenuEvent.ITEM_CLICK
Dispatched when a user selects an item from the pop-up menu.