Hi,
I meet a problem when trying to add Icons in Buttons in a ContentPanel initially collapsed (that is especially always the case in an AccordionLayout!!!). I've tried several Layouts for my ContentPanels but no success 
I use GXT 2.1.0 (with its patch mentionned in thread http://www.extjs.com/forum/showthread.php?p=412673 for GWT 2.0) and GWT 2.0
Here is a sample code:
Code:
public class TestButtonIconWindow extends Window {
public TestButtonIconWindow() {
setHeading("Test Button Icons in Expanded/Collapsed ContentPanels");
//======= A ContentPanel initially expanded
ContentPanel expanded = new ContentPanel();
expanded.setHeading("initially expanded");
expanded.setCollapsible(true);
// Buttons
Button be = new Button("text and icon", Resources.ICONS.album());
Button be2 = new Button("", Resources.ICONS.album());
Button be3 = new Button("only text");
expanded.add(be);
expanded.add(be2);
expanded.add(be3);
// ButtonBar
Button be4 = new Button("text and icon", Resources.ICONS.album());
Button be5 = new Button("", Resources.ICONS.album());
Button be6 = new Button("only text");
expanded.getButtonBar().add(be4);
expanded.getButtonBar().add(be5);
expanded.getButtonBar().add(be6);
expanded.expand();
//======= A ContentPanel initially collapsed
ContentPanel collapsed = new ContentPanel();
collapsed.setHeading("initially collapsed");
collapsed.setCollapsible(true);
// Buttons
Button bc = new Button("text and icon", Resources.ICONS.album());
Button bc2 = new Button("", Resources.ICONS.album());
Button bc3 = new Button("only text");
collapsed.add(bc);
collapsed.add(bc2);
collapsed.add(bc3);
// ButtonBar
Button bc4 = new Button("text and icon", Resources.ICONS.album());
Button bc5 = new Button("", Resources.ICONS.album());
Button bc6 = new Button("only text");
collapsed.getButtonBar().add(bc4);
collapsed.getButtonBar().add(bc5);
collapsed.getButtonBar().add(bc6);
collapsed.collapse();
// Adding ContentPanels to window
add(expanded);
add(collapsed);
}
}
Here are the results:
- Opening the window for the first time: ButtonIcons_1.png
- After expanding the ContentPanel initially collapsed: ButtonIcons_2.png
- The ButtonBar of the ContentPanel initially collapsed: ButtonIcons_3.png
Is it a known issue??? Please Help