Announcement

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

    #16
    This case should now be fixed (fix available in SVN or wait for the next nightly).
    Let us know if you continue to see it.
    Thanks

    Comment


      #17
      Regression in this feature?

      svjard was helping me on a similar thread this week, and I just stumbled upon his sample test code in this thread. I just tried this, and it does not work in the version we are using (a recent 2.2 release).

      Here is the code that I am using (v. slight variation from what he posted originally). b is a class level boolean variable as before. Can anyone verify this error in the current release?

      Code:
      	public void onModuleLoad() {
      		SC.showConsole();
      				
      		mainLayout = new VLayout();
      		
      		Menu menu = new Menu();
      		menu.setShowShadow(true);
      		menu.setShadowDepth(10);
      		
      		MenuItem subMenu = new MenuItem("SubMenu");
      		
      		Menu mySubMenu = new Menu();
      		MenuItem item1 = new MenuItem("Item 1");
      		
      		item1.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
      			@Override
      			public void onClick(MenuItemClickEvent event) {
      				b = !b;
      			}
      		});
      		
      		MenuItemIfFunction ifFunc = new MenuItemIfFunction() {
      			@Override
      			public boolean execute(Canvas target, Menu menu, MenuItem item) {
      				if (b)
      					return true;
      				return false;
      			}
          	};
          	item1.setCheckIfCondition(ifFunc);
          	mySubMenu.addItem(item1);
      		
          	subMenu.setSubmenu(mySubMenu);
          	menu.addItem(subMenu);
          	
          	MenuButton mb = new MenuButton("Menu", menu);
          	
          	mainLayout.addMember(mb);
      		mainLayout.draw();
      	}

      Comment


        #18
        I have this problem and have also noticed it on the showcase: http://www.smartclient.com/smartgwt/showcase/#menus_category_submenus
        (File>Recent docs>data.xml)

        My code. It appears checked no matter what, but the underlying functionality works.
        Code:
        		final MenuItem zoomPresetMI = new MenuItem("menu");
        		zoomPresetMI.setChecked(true);
        		zoomPresetMI.addClickHandler(new ClickHandler() {
        			public void onClick(MenuItemClickEvent event) {
        				this.toggleZoomPresetToolstrip();
        			}
        		});
        		zoomPresetMI.setCheckIfCondition(new MenuItemIfFunction() {
        			public boolean execute(Canvas target, Menu menu, MenuItem item) {
        				return false; // breakpoint here, never reached
        			}
        		});
        		
        		toolsMenu.addItem(zoomPresetMI);
        		
        		toolsB.setMenu(toolsMenu);

        Comment


          #19
          Hi,

          I had this problem too with the latest 2.2 release. Upgrading to the latest 2.3 nightly (2010-10-08) solved the problem.

          Comment

          Working...
          X