I am working in Flex 4, and wana use MenuBar control, it requires XMLList to populate its items, but the problem is, i want to apply if conditions on sub items of my menu, let me explain my problem with example:
var menubarXML:XMLList;
menubarXML=
<>
<menuitem label="File">
<menuitem label="New Sheet" data="new_sheet"/>
<menuitem label="Open Existing" data="open_sheet"/>
<menuitem label="Print" data="print"/>
//i want to apply condition here
<menuitem label="Save" data="save_pdf"/>
<menuitem label="Exit" data="exit"/>
</menuitem>
</>
For example, how can i apply condition like if (anyflag==true) disable my save menu sub item, of course the question is simple, and this issue can easily be tackled in Java and PHP.
Have an attribute in your XML with enable = true or false;
Now while parsing your xml check whether the enable is true or false, based on that you can control your menu and its child items.