Canto
26 Apr 2008, 1:56 AM
When closing tab that have d&d ContentPanel this ContentPanel doesn't die and it's still visible in previous tab (or in blank space if no tab are left). Panel isn't active, you cannot drag, collapse it but you can select text.
public class Platnosci extends Container implements EntryPoint {
RootPanel rootPanel = RootPanel.get();
public void onModuleLoad() {
rootPanel.add(this);
}
public void onRender(Element parent, int pos) {
super.onRender(parent, pos);
TabPanel tabPanel = new TabPanel();
tabPanel.enableTabScroll = true;
tabPanel.setWidth(600);
for (int i = 0; i < 5; i++) {
TabItem tab = new TabItem();
Date date = new Date();
tab.setText(date.toLocaleString().replaceFirst(
"\\d\\d:\\d\\d:\\d\\d", ""));
tab.closable = true;
tab.setHeight("100%");
HorizontalPanel hp = new HorizontalPanel();
ContentPanel cp = new ContentPanel();
cp.setHeading("lorem ipsum blah balh blah");
cp.collapsed = true;
cp.collapsible = true;
cp.draggable = true;
Draggable d = new Draggable(cp);
d.container = MainPanel.tabPanel;
hp.add(cp);
tab.add(hp);
tabPanel.add(tab);
}
rootPanel.add(tabPanel);
}
}
You can ommit HorizontalPanel the effect is still the same.
Problem seems to exists only when closing active(selected) tab.
public class Platnosci extends Container implements EntryPoint {
RootPanel rootPanel = RootPanel.get();
public void onModuleLoad() {
rootPanel.add(this);
}
public void onRender(Element parent, int pos) {
super.onRender(parent, pos);
TabPanel tabPanel = new TabPanel();
tabPanel.enableTabScroll = true;
tabPanel.setWidth(600);
for (int i = 0; i < 5; i++) {
TabItem tab = new TabItem();
Date date = new Date();
tab.setText(date.toLocaleString().replaceFirst(
"\\d\\d:\\d\\d:\\d\\d", ""));
tab.closable = true;
tab.setHeight("100%");
HorizontalPanel hp = new HorizontalPanel();
ContentPanel cp = new ContentPanel();
cp.setHeading("lorem ipsum blah balh blah");
cp.collapsed = true;
cp.collapsible = true;
cp.draggable = true;
Draggable d = new Draggable(cp);
d.container = MainPanel.tabPanel;
hp.add(cp);
tab.add(hp);
tabPanel.add(tab);
}
rootPanel.add(tabPanel);
}
}
You can ommit HorizontalPanel the effect is still the same.
Problem seems to exists only when closing active(selected) tab.