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.