Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    wac
    wac is offline
    Regular Coder wac's Avatar
    Join Date
    Sep 2002
    Location
    Cary, North Carolina, USA
    Posts
    359
    Thanks
    2
    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

  • #2
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,007
    Thanks
    59
    Thanked 10 Times in 10 Posts
    Its all up to your taste. ;-)


  • #3
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,007
    Thanks
    59
    Thanked 10 Times in 10 Posts


  • #4
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 1 Time in 1 Post

    popupMenuButton

    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:

    wac (04-21-2011)

  • #5
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    Quote Originally Posted by NorthernPike View Post
    The use of this control is what is confusing people. It's not a menu provider.
    I disagree. It is, in fact, a menu provider - with the added feature of allowing a user-selectable default action. As you stated, it is very powerful - as a menu provider. While it may, depending on your approach, bring additional programmer-work to the table, that is no reason to avoid its use. Especially in cases where a user may want to establish a default action for a particular session there is no control better suited.

    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 ...
    Quote Originally Posted by nikos101 View Post
    Its all up to your taste. ;-)
    John

  • Users who have thanked PappaJohn for this post:

    wac (04-21-2011)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •