【发布时间】:2009-10-27 18:25:58
【问题描述】:
我创建了一个选项卡面板,单击按钮可以在其中添加其他选项卡。
我不知道如何删除不是最后添加的选项卡。
我在这里....
TabPanel tp = new TabPanel(); HorizontalPanel tabPanel = new HorizontalPanel(); Label textLabel = new Label("Some Filename"); 按钮 killButton = new Button("x");
tabPanel.add(textLabel); tabPanel.add(killButton);
tp.add(new HTML("Some Content"), tabPanel);//正文和标题
killButton.addClickHandler(新 ClickHandler(){ public void onClick(ClickEvent 事件){
//Decide the Tab index that contains this button
//Remove this tab based on index
} });//addClickHandler方法结束
当我尝试使用 getWidgetIndex() 方法返回特定选项卡的索引时,我每次都会得到 -1。
如何正确返回选项卡的索引?
请帮忙,我快疯了!!!
:-(
【问题讨论】:
标签: gwt