6 Replies Latest reply: Jun 19, 2012 1:02 AM by jrunrandy RSS

    MenuBar control

    community help Community Member

      This question was posted in response to the following article: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html

        • 1. Re:  MenuBar control
          Claudius Tiberiu Iacob

          This code does not reder properly. ITem D-3 is rendered in place of item D-2, which is SKIPPED. Is there a fix for this?I'm using SDK 4.6

                ;

          • 2. Re:  MenuBar control
            Claudius Tiberiu Iacob Community Member

            THAT code. This page ate my XML...

             

                  <root>

                      <menuitem label="MenuItem A" icon="myTopIcon">

                           <menuitem label="SubMenuItem A-1" enabled="False"/>

                           <menuitem label="SubMenuItem A-2"/>

                      </menuitem>

                      <menuitem label="MenuItem B" type="check" toggled="true"/>

                      <menuitem label="MenuItem C" type="check" toggled="false" icon="myTopIcon"/>

                      <menuitem type="separator"/>

                      <menuitem label="MenuItem D" icon="myTopIcon">

                           <menuitem label="SubMenuItem D-1" type="radio" groupName="one">

                                <menuitem label="SubMenuItem D-2" type="radio" groupName="one">

                                     <menuitem label="SubMenuItem D-3" type="radio" groupName="one" />

                                </menuitem>

                           </menuitem>

                           <menuitem label="SubMenuItem D-2" type="radio" groupName="one" toggled="true"/>

                           <menuitem label="SubMenuItem D-3" type="radio" groupName="one"/>

                      </menuitem>

                 </root>

            • 3. Re:  MenuBar control
              jrunrandy Adobe Employee

              @Claudius,

              I'm not exactly sure what you want to render, but I removed the root element, tweaked the first D-1 tag, and got the following to work:

               

              <menuitem label="MenuItem A" icon="myTopIcon">                                

              <menuitem label="SubMenuItem A-1" enabled="False"/>                                 

              <menuitem label="SubMenuItem A-2"/>

              </menuitem>

              <menuitem label="MenuItem B" type="check" toggled="true"/>

              <menuitem label="MenuItem C" type="check" toggled="false" icon="myTopIcon"/>

              <menuitem type="separator"/>

              <menuitem label="MenuItem D" icon="myTopIcon">                                 

              <menuitem label="SubMenuItem D-1" type="radio" groupName="one">                                   

              <menuitem label="SubMenuItem D-2" type="radio" groupName="one"/>                                   

              <menuitem label="SubMenuItem D-3" type="radio" groupName="one" />                 

              </menuitem>                                <menuitem label="SubMenuItem D-2" type="radio" groupName="one" toggled="true"/>

              <menuitem label="SubMenuItem D-3" type="radio" groupName="one"/>

              </menuitem>

               

              Regards,

              Randy Nielsen

              Senior Content and Community Manager

              Adobe Systems Incorporated

              • 4. Re:  MenuBar control
                Claudius Tiberiu Iacob Community Member

                Dear jrunrandy

                Thank you for your interest in this matter.

                I isolated the issue by trimming away all unnecessary code. Have a look at the following MXML Application:

                 

                <?xml version="1.0" encoding="utf-8"?>

                 

                <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                 xmlns:s="library://ns.adobe.com/flex/spark"

                                                 xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

                 

                    <fx:Declarations>

                 

                        <fx:XML id="myData" xmlns="">

                            <menu>

                                <menuitem label="Level 0" icon="myTopIcon">                                

                                    <menuitem label="Level 1" type="radio" groupName="one">                                  

                                        <menuitem label="Level 2" type="radio" groupName="one">

                                            <menuitem label="Level 3" type="radio" groupName="one" />                

                                        </menuitem>

                                    </menuitem>                               

                                </menuitem>

                            </menu>

                         </fx:XML>

                 

                    </fx:Declarations>

                 

                     <mx:MenuBar

                         dataProvider="{myData}"

                         width="100%"

                         labelField="@label"

                         showRoot="false"/>

                 

                </s:Application>

                 

                IMHO, this code should render a menu resembling to this hierarchical structure:

                 

                Level 0

                    -> Level 1

                            -> Level 2

                                     -> Level 3

                 

                However, the menu that is rendered resembles to this structure (also check the attached screen shot):

                Level 0

                   -> Level 1

                           -> Level 3

                 

                MenuBar_Issue.png

                • 5. Re:  MenuBar control
                  Claudius Tiberiu Iacob Community Member

                  P.S.: Removing the type="radio" attribute does not resolve the issue.

                   

                  Thank you

                  • 6. Re:  MenuBar control
                    jrunrandy Adobe Employee

                    Hi Claudius,

                    OK. I see. I'm able to reproduce this. I'm not sure where to report Flex bugs these days. I suggest trying either bugs.adobe.com or the Apache Flex site.

                     

                    -Randy