0

I have a TabPanel with two TabItems in ExtGwt. I want to make both the TabItem selectable/clickable but want to disable/read-only the content panel in the TabItem so that user can not perform any action like input text in the textbox or select any field etc. I tried various approaches but it didnot worked for me. I don't want to make the whole tab disable.

kkishere
  • 154
  • 2
  • 13

1 Answers1

0

This answer may be useful: https://stackoverflow.com/a/2063082/1313968

An alternative approach is to disable all components in the panel, for example just pass your ContentPanel to the following method:

private void containerSetEnabled(final Container container, final boolean enabled) {
  for (int widgetIndex = 0; widgetIndex < container.getWidgetCount(); ++widgetIndex) {
    final Widget widget = container.getWidget(widgetIndex);
    if (widget instanceof Container) {
      containerSetEnabled((Container)widget, enabled);
    }
    else if (widget instanceof Component) {
      ((Component)widget).setEnabled(false);
    }
  }
}
Community
  • 1
  • 1
Andy King
  • 1,632
  • 2
  • 20
  • 29