Announcement

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

    possible bug with recent menubar changes in nightly builds

    I'm using Smartclient LGPL v8, sometimes testing with nightly builds
    Something happened to the menu bar that I display in my application between snapshots 2011-04-22 and 2011-04-25. I built a standalone case and tested it in firefox 4 , safari 5 and Chrome (MacOS X) and got the same results. Since v7 and up to snapshot 22, everything worked well. From snapshot 25, the menu bar does not appear anymore. I get no errors from the javascript or smartclient consoles.

    the standalone case is made of two files :
    application.js and menu.js
    application.js manages the main layout and menu.js defines a subclass of menubar.

    Apparently, the setMenus function has been modified between these snapshots, and is likely to be the cause of this new behaviour. Is it a bug or should I write my menubar subclass in a different way ?

    Code:
    /* application.js */
    var corps = isc.SectionStack.create({
    	ID: "corps",
        autoDraw: false,
        visibilityMode: "multiple",
        sections: [
    		isc.LayoutSpacer.create({width:"100%",height:"100%"})
    	]
    });
    
    var interfaceMenu = isc.InterfaceMenu.create();
    
    var appLayout = isc.VLayout.create({
        autoDraw:false,
        width: "100%",
        height: "100%",
        members: [interfaceMenu, corps],
    	initWidget: function(){
    		this.Super("initWidget", arguments);
    
    		isc.Page.setEvent("load",this,"once","draw");
    	}
    });
    menu.js
    Code:
    isc.ClassFactory.defineClass("InterfaceMenu","MenuBar");
    isc.InterfaceMenu.addProperties({
        autoDraw: false,
    	width:"100%",
    	initWidget: function(){
    		this.Super("initWidget", arguments);
    
    		this.menuOne = isc.Menu.create({
    			autoDraw: false,
    			width: 100,
         		title: "menu1" ,
    			showIcons: false,
    		    showShadow: true,
    			data: [
    				{
    	       			title: "one 1" ,
    	   				click: function() {
    	   					isc.warn("one 1");
    	   				}
    				},
    				{
    	       			title: "one 2" ,
    	   				click: function() {
    	   					isc.warn("one 2");
    	   				}
    				},
    			]			
    		});
    
    		this.menuTwo = isc.Menu.create({
    			autoDraw: false,
    			width: 100,
         		title: "menu2" ,
    			showIcons: false,
    		    showShadow: true,
    			data: [
    				{
    	       			title: "two 1" ,
    	   				click: function() {
    	   					isc.warn("two 1");
    	   				}
    				},
    				{
    	       			title: "two 2" ,
    	   				click: function() {
    	   					isc.warn("two 2");
    	   				}
    				}
    			]			
    		});
    
    		this.setMenus([
    			this.menuOne, 
    			this.menuTwo
    		]);
    	}, //initWidget
    });
    index.html (I made several copies to test the various snapshots)
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta name="generator" content= "HTML Tidy, see www.w3.org" />
            <meta http-equiv="Content-Type" content= "text/html; charset=utf-8" />
      		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
           <script type="text/javascript">
                var isomorphicDir = "isomorphic22/";
            </script>
            <script type="text/javascript" src="isomorphic22/system/modules/ISC_Core.js">
            </script>
            <script type="text/javascript" src="isomorphic22/system/modules/ISC_Foundation.js">
            </script>
            <script type="text/javascript" src="isomorphic22/system/modules/ISC_Containers.js">
            </script>
            <script type="text/javascript" src="isomorphic22/system/modules/ISC_Grids.js">
            </script>
            <script type="text/javascript" src="isomorphic22/system/modules/ISC_Forms.js">
            </script>
            <script type="text/javascript" src="isomorphic22/system/modules/ISC_DataBinding.js">
            </script>
            <script type="text/javascript" src="isomorphic22/system/modules/ISC_Calendar.js">
            </script>
            <script type="text/javascript" src="isomorphic22/skins/EnterpriseBlue/load_skin.js">
            </script>
            <script type="text/javascript" src="isomorphic22/locales/frameworkMessages_fr_FR.properties">
            </script>
             <title>testmenubar</title>
        </head>
        <body>
    		<script type="text/javascript" src="menu.js"></script>
    		<script type="text/javascript" src="application.js"></script>
        </body>
    </html>

    #2
    There's a trailing comma in the "data" Array for Menu one. This adds a null slot, which is an error. We also don't see anything that's changed recently in Menu or Menubar that could explain how this could work before.

    Comment


      #3
      I agree with you, I don't see how the slight change to SetMenus would break anything. I have uploaded the standalone case after checking my code with jslint. No more trailing commas :-) and you can see how the menus appear, but not the bar.
      I added the latest nightly build too.
      You can see them here.

      http://arkad.fr/testmenubar/index.html

      Comment


        #4
        Thanks, that pointed out a change in another class which had a subtle effect on MenuBar. Fixed now.

        Comment

        Working...
        X