I find PopUpButton, PopUpMenuButton and ComboBox controls have the same function and behavior in Flex. What's the difference 开发者_StackOverflow社区between them? Are they redundant?
Thanks
combobox and popupbutton extends different classes so they inherit different properties and methods. popupmenubutton extends popupbutton and has some new properties: dataDescriptor, dataProvider, iconField, iconFunction and others (see AS3 docs)
This answer is very very late, but I just happened to be searching for the same thing.
I found an answer here: http://www.codingforums.com/showthread.php?t=147744
Credits to PappaJohn from the forum.
Transcribed below:
The Combobox: while it can be used (with the proper techniques) to function as a menu selection choice, its primary function is similar to that of a tag in html - to provide a limited number of values to a particular prompt, as opposed to requiring the user to manually enter a value. This can be used to help the user and to the programmer by limiting the user-selected values to a pre-determined list of acceptable choices - a "white-list", if you will.
The PopupMenuButton: is designed to pop-up a menu, and thereby providing a list of available actions (as opposed to values) for the user to select (assuming it is used properly).
The PopupButton: can be used to pop-up a menu but also it can pop-up any UIComponent - which may present a possible action (or actions) or a possible value (or values) depending on the context in which it is used.
精彩评论