Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
08-30-2008, 08:55 PM #1
- Join Date
- Sep 2002
- Cary, North Carolina, USA
- Thanked 0 Times in 0 Posts
CombBox vs PopupButton vs PopupMenuButton
These controls seem to perform the same basic function. Can anyone point me to a decent description of when I would use one control vs the other?Wayne Christian
09-04-2008, 02:13 PM #2
Its all up to your taste. ;-)
09-04-2008, 02:22 PM #3
04-21-2011, 03:57 AM #4
- Join Date
- Apr 2011
- Thanked 1 Time in 1 Post
I just went through hell using this control. Didn't realize that the left button dispatches an itemClick event as well as a click event. This makes it nearly impossible to determine whether the user clicked a selection of the menu or just clicked the button. My boss turned me on to this control thinking it was what I was looking for. Not so. I wanted a button to pop-up a menu. Not change the button behavior dynamically via user selection of a menu item. The use of this control is what is confusing people. It's not a menu provider. It's a dynamic button who's functionality can be changed by the user via menu selections. It's a very cool control when used for it's intended purpose. But try using it as a menu and it will fight you all the way.
Now, the popupButton, parent to the popupMenuButton, can popup anything derived from UIComponent. So I popped up a menu. This controls button does NOT dispatch an itemClick event when clicked as it's child, popupMenuButton, does. That's a big difference. One allows the developer to present the user with any UIComponent be it a calender, password type input, list of items etc... The other allows a user to set the functionality of the button at runtime. Very powerfull. But it is not a menu provider and should not be used as such. It's name, popupMenuButton is very missleading.
Users who have thanked NorthernPike for this post:
04-21-2011, 05:04 AM #5
- Join Date
- Apr 2007
- Quakertown PA USA
- Thanked 125 Times in 123 Posts
The popupMenuButton is what it is - a custom control, albeit one provided by Adobe. The better approach is to learn the techniques necessary to use this control as it was intended.
To the original question:
While these controls do provide similar functionality, that functionality is not necessarily exactly the same.
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 <select> 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 (as NorthernPike noted) 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.
The deciding factors are (1) the context in which the control is to be used, and (2) the GUI used by the application. In other words ...