Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Menu with "Empty Menu" Message in SC8

    I'd like to be able to use the menu button which does not contain embedded menus. I have the following code below but the problem is it still shows an empty menu below. How do I suppress this? The JS code works fine in SC7.

    Code:
    isc.Menu.create({
        ID: "menu",
        autoDraw: false,
        showShadow: true,
        shadowDepth: 10
    });
    
    isc.MenuButton.create({
        ID: "menuButton",
        title: "File",
        width: 100,
        menu: menu,
       click: function(){isc.warn('click');}
    
    });

    #2
    Probably best to simply not assign the menu to the MenuButoon if it has no items and you don't want to see the empty menu placeholder.

    Comment


      #3
      I have tried this, but I get an NPE in IE8 in ISC_Grid.js

      Code:
      $36d:function(_1){_1.autoDraw=false;var _2=this.menuConstructor

      Comment


        #4
        We need this resolved ASAP to move to SC8 please. Thanks.

        Comment


          #5
          I don't see this in my testing. Can you pick up the latest nightly and retry?

          Comment


            #6
            Sure I'll let you know.

            Comment


              #7
              I've tried the same scenario with the build SmartClient_SC_SNAPSHOT-2010-05-18 and the NPE still occurs. Do you have Developer Tools in IE on debug mode? Note that I also only get the error when my warn message is on the screen. Once I click ok the error on the browser disappears.

              Comment


                #8
                I've also tried with the following example:

                Code:
                isc.Label.create({ID: "testLabel", contents: "test"});
                
                isc.MenuButton.create({
                    ID: "menuButton",
                    title: "File",
                    width: 100,
                click: function(){testLabel.setContents("TEST");}
                });
                With this example, the JS error in IE shows all the time whereas the above example only shows the JS error when the warning dialog is present.

                Comment


                  #9
                  I am unable to reproduce this with either example. How are you testing these samples? Are you copying this into a feature explorer sample? If not, what additional code is involved?

                  Comment


                    #10
                    I'm testing it with Feature Explorer. That's the only code I have. In fact, that's just a modified version of the demo in Control->Menus->Appearance.

                    I am using IE8 if that makes any difference.
                    Last edited by acarur01; 19 May 2010, 04:31.

                    Comment


                      #11
                      I was able to track down the issue and the fix should be available in the nightly tomorrow. In your use case do you want the down arrow to show?

                      Comment


                        #12
                        No. If there are no submenus the down arrow is pointless.

                        Do you by any chance know if there is a list of changes I can look at for each build?

                        Comment


                          #13
                          I'm not aware of a change list with the builds.

                          Comment


                            #14
                            I just ran the latest build..still the same problem.

                            Comment


                              #15
                              I have another case in which I have a second level menu with data. This menu data is dynamically manipulated depending on the current state (whether to show part of the data or not). In some cases, I have an empty data array. If you run the example, this will show "Empty menu". I need a way to suppress this. Unfortunately, temporarily override the click method to do nothing does not work if there is an empty data list set on the menu.


                              Code:
                              
                              isc.MenuButton.create({ID:"MenuItem",
                              canFocus:true,
                              title:" Visibility Test",
                              showDown:false,
                              showFocused:false,
                              showEmptyMessage:false,
                              showRollOver:false,
                              autoFit:true,
                              baseStyle:"CwMEIDef",
                              align:"bottom",
                              showMenuButtonImage:false,
                              menu:isc.Menu.create({ID:"MenuItem$menu",
                              fastCellUpdates:false,
                              canFocus:true,
                              title:"Visibility Test ",
                              showDown:false,
                              data:
                              [{title:"Visible",ID:"MenuItem1"},
                              {title:"Menu",submenu:isc.Menu.create({ID:"MenuItem2",fastCellUpdates:false,ID:"MenuItem2",data:[]})}
                              ]})});

                              Comment

                              Working...
                              X