Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    102
    Vote Rating
    1
    scaswell1 is on a distinguished road

      0  

    Default Tabs in TabPanel do not effectively communicate disabled status

    Tabs in TabPanel do not effectively communicate disabled status


    In GXT 2.x, when a TabItem was disabled, two things would happen:
    1. The text of the tab would be grayed out to indicate the disabled state
    2. The mouse would remain in default pointer style when hovering over the tab
    In GXT 3.0.3, neither of these things happen. I realize I can do these things manually, but I wanted to find out if there was any reason these behaviors aren't baked directly into a fairly standard scenario.

    Thanks!


    **Edit: In addition, if the TabItemConfig is set disabled, my setHTML on the config to *manually* style the tab to look disabled seems to be ignored.
    Last edited by scaswell1; 25 Jan 2013 at 9:28 AM. Reason: More details

  2. #2
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    102
    Vote Rating
    1
    scaswell1 is on a distinguished road

      0  

    Default


    Code:
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.HTML;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.sencha.gxt.widget.core.client.ContentPanel;
    import com.sencha.gxt.widget.core.client.TabItemConfig;
    import com.sencha.gxt.widget.core.client.TabPanel;
    
    
    /**
     * Main entry point.
     *
     * @author sec
     */
    public class MainEntryPoint implements EntryPoint {
    
    
        /**
         * Creates a new instance of MainEntryPoint
         */
        public MainEntryPoint() {
        }
    
    
        /**
         * The entry point method, called automatically by loading a module that
         * declares an implementing class as an entry-point
         */
        public void onModuleLoad() {
            TabPanel tp = new TabPanel();
            TabItemConfig cfg = new TabItemConfig("Test");
            TabItemConfig cfg2 = new TabItemConfig("Won't work :(");
            tp.add(new HTML("HELP!"), cfg);
            tp.add(new HTML("Please?"), cfg2);
            cfg2.setEnabled(false);
            cfg2.setHTML("<span color=\"red\">Won't work :(</span>");
            
            ContentPanel gxtFormPanelWrapper = new ContentPanel();
            gxtFormPanelWrapper.setHeadingText("GXT FormPanel");
            gxtFormPanelWrapper.setWidget(tp);
    
    
            RootPanel.get().add(gxtFormPanelWrapper);
        }
    }

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    A quick test of 3.0.1 at http://www.sencha.com/examples/#ExamplePlace:basictabs and http://www.sencha.com/examples/explo...lace:basictabs seems to show the default mouse cursor as well as a grayed out tab and text (tested briefly in ff and chrome)

    3.0.3, at http://staging.sencha.com:8080/examp...lace:basictabs also seems to be behaving correctly.

    Briefly debugging your example, it looks like you are invoking the enabled setter *after* using that config to add the item to the tabpanel (same with overwriting the html - but color is not a valid html attribute). Instead, make the change first, then add it, or you must invoke


    Code:
      public void onModuleLoad() {
          TabPanel tp = new TabPanel();
          TabItemConfig cfg = new TabItemConfig("Test");
          TabItemConfig cfg2 = new TabItemConfig("Won't work :(");
          cfg2.setEnabled(false);
          cfg2.setHTML("<span color=\"red\">Won't work :(</span>");//color doesn't do anything, text still works because of the constructor arg
          tp.add(new HTML("HELP!"), cfg);
          tp.add(new HTML("Please?"), cfg2);
          
          ContentPanel gxtFormPanelWrapper = new ContentPanel();
          gxtFormPanelWrapper.setHeadingText("GXT FormPanel");
          gxtFormPanelWrapper.setWidget(tp);
    
          RootPanel.get().add(gxtFormPanelWrapper);
      }
    or
    Code:
      public void onModuleLoad() {
          TabPanel tp = new TabPanel();
          TabItemConfig cfg = new TabItemConfig("Test");
          TabItemConfig cfg2 = new TabItemConfig("Won't work :(");
          tp.add(new HTML("HELP!"), cfg);
          HTML widget = new HTML("Please?");
          tp.add(widget, cfg2);
          cfg2.setEnabled(false);
          cfg2.setHTML("<span color=\"red\">Won't work :(</span>");//color doesn't do anything, text still works because of the constructor arg
          tp.update(widget, cfg2);
          
          ContentPanel gxtFormPanelWrapper = new ContentPanel();
          gxtFormPanelWrapper.setHeadingText("GXT FormPanel");
          gxtFormPanelWrapper.setWidget(tp);
    
          RootPanel.get().add(gxtFormPanelWrapper);
      }

Thread Participants: 1