Search code examples
apache-flexflex4contextmenuitemrenderer

Flex4 ContextMenu() not showing added Items


I am trying to use ContextMenu() to display context menus in Flex 4.

Full Render code here http://pastebin.com/Kx8tJ1cY

The problem is that the context menu does not change when I add items to it.

Can anyone show me how to add a custom right click menu to a List box in flex (without using external JS, just using ContextMenu as Adobe intended.

Please and Thank you Craig


Solution

  • I found the problem/solution. You cant use context menus if there are Vboxes or Tab Navigators. Which is insane because it means I cant do relative layout properly or decent variable width design.

    Quoted from: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/ContextMenu.html

    For example, if a DataGrid control is a child of a TabNavigator or VBox container, the DataGrid control cannot have its own context menu.