Hi there,
I need some help with ToolButtons and ContentPanel. I have a ContentPanel that has two sub ContentPanel. I need to collapse the external ContentPanel and the north ContentPanel, and I want to collapse the external ContentPanel using a ToolButton added in the header of the sub north ContentPanel (in this way I can hide the external ContentPanel header). My problem is that when I collapse the north ContentPanel the ToolButton I added disappears(so I can't collapse the external ContentPanel). How can I keep my ToolButton visible? 


Here is what I've done...
Code:
ContentPanel panel;
ContentPanel north = null;
ContentPanel center = null;
public SomethingToShow() {
panel = new ContentPanel();
panel.setLayout(new BorderLayout());
panel.setHeaderVisible(false);
north = new ContentPanel();
center = new ContentPanel();
//North
final BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH);
northData.setCollapsible(true);
Header header = north.getHeader();
//This button collapse the parent ContentPanel
ToolButton collapseMainPanel = new ToolButton("x-tool-left");
header.addTool(collapseMainPanel);
collapseMainPanel.addSelectionListener(new SelectionListener<IconButtonEvent>() {
public void componentSelected(IconButtonEvent ce) {
panel.collapse();
}
}
);
panel.add(north, northData);
//South
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
panel.add(center, centerData);
}
Thanks in advance!