Flex2 a MenuBar with toggled menuitems

Posted on June 21, 2006 | Comments Off

The MenuBar and Menu components of the Flex2 framework are nice tools in creating standard business applications. As you look through the examples located in the documentation you might find some issues with the <menuitem/> model attributes. You can define the menuitem’s nodes with the ability to show a check mark or radio dot next to the menuitems. This is done through the attribute “type”. If you click on these menuitems they will display the check mark or radio dot next to the menuitem.

Now in most applications you will want to define the defaults of the menuitems. The documentation does not shed a lot of help on this. So I decided to find the name of the attribute of menuitem that defines the state of the check mark or radio dot. “selected” or “checked” did not work but after using some debug script I was able to find the mystery attribute. It was called “toggled”. Check out the source code, it shows the toggled attribute being used and also some debug code to further learn about the menuitem XML node structure.

http://renaun.com/flex2/MenuBarToggleExample/

Toggled is new to me, wonder if it has found it self in the Flex2 framework in other places as well?