Is there any way to know the parent/component which initiates context menu?
I have a panel which contains different custom components. i want to open respective popup window of custom component from context menu when user right click on the respective component.
How can i find the parent custom component which initiates context menu?
for ex:
custom compoent: 1. Label, 2. Buttom
context menu Item: properties
On right click over ‘Label’ opens a context menu which has item ‘properties’, on clicking properties it should open custom popoup window showing properties of Label.
similarly, for Button.
I am trying to listen Event on click of context menu, but it is not useful.
what is the correct way to achieve this?
Try adding a listener for ContextMenuEvent.MENU_SELECT to the actual
contextMenuproperty on each of the components. In the handler you can do something like:That’s one way of doing it. Personally, I usually make the custom context menus ahead of time, and set them on each component in the MXML. However, doing it dynamically (as above) might be better in some circumstances.