-
25 Jan 2013 9:10 AM #1
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:
- The text of the tab would be grayed out to indicate the disabled state
- The mouse would remain in default pointer style when hovering over the tab
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
-
28 Jan 2013 5:22 AM #2
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); } }
-
28 Jan 2013 5:18 PM #3
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
orCode: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); }
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); }
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote