Hi ,
I have created a Tab panel where additional tabs can be added on clicking a button.
What I cannot figure out is how to remove a tab that is not the one that was added last.
Here's where I am....
TabPanel tp = new TabPanel(); HorizontalPanel tabPanel = new HorizontalPanel(); Label textLabel = new Label("Some Filename"); Button killButton = new Button("x");
tabPanel.add(textLabel); tabPanel.add(killButton);
tp.add(new HTML("Some Content"), tabPanel);//Body and header
killButton.addClickHandler( new ClickHandler(){ public void onClick(ClickEvent event){
//Decide the Tab index that contains this button
//Remove this tab based on index
} });//End of addClickHandler method
When I try to use the getWidgetIndex() method to return the index of a particular tab I get -1 everytime.
How do I correctly return an index of a tab?
please help as I am going insane!!!
:-(