Announcement

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

    CloseTabIcon missing

    Hi Isomorphic,

    I'm using SmartGWT Pro 2.5 branch (10/21/2011 nightly build).

    The Tab does not have a closeTabIcon by using the tab.setCanClose(true) if it was not set on Tab's creation.

    Please see the code:
    Code:
    public class TabTest implements EntryPoint {
      public void onModuleLoad() {
    
    	TabSet tabset = new TabSet();
        	tabset.setTabBarPosition(Side.TOP);  
        	tabset.setWidth100();
        	tabset.setHeight100();
        	
            Tab tab1 = new Tab("Tab1");
            tab1.setCanClose(new Boolean(true));
            tabset.addTab(tab1);
            
            Tab tab2 = new Tab("Tab2");
            tabset.addTab(tab2);
        	
            Canvas canvas = new Canvas();
            canvas.setWidth100();
            canvas.setHeight100();
            canvas.addChild(tabset);
            canvas.draw();
            
            tabset.addTabSelectedHandler(new TabSelectedHandler() {
    	    public void onTabSelected(TabSelectedEvent event)
    	    {
    	        Tab tab = event.getTab();
    	        if (tab.getCanClose() == false)
    	            tab.setCanClose(new Boolean(true));
    	    }
    	});
      }
    }
    The first tab1 has the closeTabIcon and can be closed.
    The second tab2 does not have the closeTabIcon after using the tab2.setCanClose(true) on tab's selection.

    How can I add the closeTabIcon to the second tab? I need to add it per request, not during the initialization.

    Thank you.
Working...
X