PDA

View Full Version : [FIXED] ContentPanel expand/collapse bug



mimikoko
2 Apr 2009, 7:21 AM
Hallo,
the one ContentPanel can not collapse.


I have:
GWT: 1.5.3
GXT: 1.2.3

My example for bug:


public class Test implements EntryPoint {

private final ContentPanel panelA = new ContentPanel();
private final ContentPanel panelB = new ContentPanel();


public void onModuleLoad() {

Button button1 = new Button("expand A, collapse B");
button1.addListener(Events.Select, new Listener<ButtonEvent>(){
public void handleEvent(ButtonEvent be) {
panelA.expand();
panelB.collapse();

// even worse, however, if the functions swapped (see Error_2)
//
// first -> panelB.collapse();
// then -> panelA.expand();
}
});
Button button2 = new Button("collapse A, expand B");
button2.addListener(Events.Select, new Listener<ButtonEvent>(){
public void handleEvent(ButtonEvent be) {
panelB.expand();
panelA.collapse();

// even worse, however, if the functions swapped (see Error_2)
//
// first -> panelA.collapse();
// then -> panelB.expand();

}
});


panelA.setHeading("Panel A");
panelA.add(new Label("I am panelA!"));
panelA.collapse();

panelB.setHeading("Panel B");
panelB.add(new Label("I am panelB!"));
panelB.collapse();

RootPanel.get().add(button1);
RootPanel.get().add(button2);
RootPanel.get().add(panelA);
RootPanel.get().add(panelB);
}
}

sven
2 Apr 2009, 7:40 AM
You can for now turn of animation. Or you listen for the Expand/Collapse events and do the second panelaction in that listener.


panelA.setAnimCollapse(false);
panelB.setAnimCollapse(false);

mimikoko
2 Apr 2009, 8:01 AM
thanks sven

sven
6 Apr 2009, 1:52 PM
Fixed in SVN