Announcement

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

    MenuItem enableIfCondition prob

    Hi all !

    I've just updated smartgwt in 2.2, and I had a problem:

    All the menuItem who owns the method 'setEnableIfCondition' throw exceptions ....

    I took one of the showcase example and I added the method 'setEnableIfCondition':

    Code:
    MenuItem newItem = new MenuItem( "New", "icons/16/document_plain_new.png", "Ctrl+N" );
    		newItem.setEnableIfCondition( new MenuItemIfFunction()
    		{
    			
    			public boolean execute( Canvas target, Menu menu, MenuItem item )
    			{
    				// TODO Auto-generated method stub
    				return false;
    			}
    		} );
    		MenuItem openItem = new MenuItem( "Open", "icons/16/folder_out.png", "Ctrl+O" );
    		
    		MenuItem saveItem = new MenuItem( "Save", "icons/16/disk_blue.png", "Ctrl+S" );
    		MenuItem saveAsItem = new MenuItem( "Save As", "icons/16/save_as.png" );
    		
    		MenuItem recentDocItem = new MenuItem( "Recent Documents", "icons/16/folder_document.png" );
    		
    		Menu recentDocSubMenu = new Menu();
    		MenuItem dataSM = new MenuItem( "data.xml" );
    		dataSM.setChecked( true );
    		MenuItem componentSM = new MenuItem( "Component Guide.doc" );
    		MenuItem ajaxSM = new MenuItem( "AJAX.doc" );
    		recentDocSubMenu.setItems( dataSM, componentSM, ajaxSM );
    		
    		recentDocItem.setSubmenu( recentDocSubMenu );
    		
    		MenuItem exportItem = new MenuItem( "Export as...", "icons/16/export1.png" );
    		Menu exportSM = new Menu();
    		exportSM.setItems( new MenuItem( "XML" ), new MenuItem( "CSV" ), new MenuItem( "Plain text" ) );
    		exportItem.setSubmenu( exportSM );
    		
    		MenuItem printItem = new MenuItem( "Print", "icons/16/printer3.png", "Ctrl+P" );
    		printItem.setEnabled( false );
    		
    		MenuItemSeparator separator = new MenuItemSeparator();
    		
    		Menu menu = new Menu();
    		
    		menu.setShowShadow( true );
    		menu.setShadowDepth( 10 );
    		
    		menu.setItems( newItem, openItem, separator, saveItem, saveAsItem, separator, recentDocItem, separator, exportItem,
    				separator, printItem );
    		
    		IMenuButton menuButton = new IMenuButton( "File", menu );
    		menuButton.setWidth( 100 );
    		menuButton.draw();
    	}

    Is this appear for other people ?
    Any issue ??


    Thanks

    #2
    Use a latest nightly build, it shouldn't appear there. smartclient.com/builds

    Comment

    Working...
    X