views:

768

answers:

1

is this a bug or my fault?

<mx:MenuBar width="100%" labelField="@label" itemClick="menuItemClickHandler(event)">
  <mx:XMLList>
           <menuitem label="User" >
    <menuitem label="Log In" showDialog="LoginDialog" enabled="{model.FlowUserState == 0}" />
    <menuitem label="Log Out" dispatchEvent="LogoutEvent" enabled="{model.FlowUserState >= 1}" />
   </menuitem>
   <menuitem label="Job">
                <menuitem label="Open" showDialog="OpenJobDialog" enabled="{model.FlowUserState >= 1}" />
                <menuitem label="Close" enabled="{model.job_id != null}" dispatchEvent="CloseJobEvent" />
                <menuitem label="New" enabled="{model.FlowUserState >= 4}" />
                <menuitem type="separator"/>
                <menuitem label="info" enabled="{model.job_id != null}" />
                <menuitem label="status codes" enabled="{model.job_id != null}"/>
            </menuitem>
        </mx:XMLList>

the Login and Logout buttons remain always active, no matter what. If I switch the User and the Job menus, though, the problem disappears for the User menu and the Open and Close buttons are always active now... seems a bug to me.

Is there any alternative to the flex menubar? It's not such a great component..

A: 

Solved it. It's indeed a bug.. or better, it's not implemented as it should be (as everything else is.. with bindings working!!)

Follow this tutorial to fix the problem and generally enhance the menubar: http://frishy.blogspot.com/2007/12/making-flex-menus-easier.html

luca