1 Reply Latest reply on Jan 26, 2010 12:23 PM by rick@cat

    MenuBar does not display

    Gregory Lafrance Level 6

      If I have a simple menubar in main app mxml file it displays fine, but if I put in a separate MXML component it displays, but with no menu items.

       

      Any ideas?

        • 1. Re: MenuBar does not display
          rick@cat Level 1

          Greg,

          I just tried it in a test I was doing and it worked fine for me. Here's the code:

           

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
              <mx:XML format="e4x" id="menuXML">
                  <root strLabel="root node">
                      <menuitem strLabel="Equipment">
                          <menuitem strLabel="Equipment List"/>
                          <menuitem strLabel="Equipment Types"/>
                      </menuitem>
                      <menuitem strLabel="Work Orders">
                          <menuitem strLabel="Task List"/>
                          <menuitem strLabel="Work Order List"/>
                      </menuitem>
                      <menuitem strLabel="Parts List"/>
                      <menuitem strLabel="Address Book"/>
                      <menuitem strLabel="Reporting"/>
                      <menuitem strLabel="Logout"/>
                  </root>
              </mx:XML>
              <mx:MenuBar id="mb" borderColor="#BCBCBC" showRoot="false" dataProvider="{menuXML}"
                          right="0" left="0" top="0" width="100%" labelField="@strLabel" color="#000000"
                          fontSize="11" fontWeight="bold" fontFamily="Verdana" useHandCursor="true"/>

              <mx:DataGrid x="75" y="96">
                  <mx:columns>
                      <mx:DataGridColumn headerText="Column 1" dataField="col1"/>
                      <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
                      <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
                  </mx:columns>
              </mx:DataGrid>
          </mx:Module>

           

          Maybe it's your dataProvider reference?

          Rick