O'Reilly logo

ExtGWT Rich Internet Application Cookbook by Odili Charles Opute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programmatically adding/removing a tab

The GXT toolkit makes it really easy to add or remove a tab from a tab panel. Within code, however, there is a little twist to removing tabs, because in real-world use cases you'll want to do this conditionally. That is, you want to check for a precondition, in the absence of which you will reject or decline, or better still, cancel the request to remove (or close) a tab from its containing TabPanel object.

Programmatically adding/removing a tab

How to do it...

To properly see this in action, we will create two buttons, one that the user can click to add a tab and another to remove the currently selected tab (active tab). However, we will prevent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required