View Full Version : [FIXED] Bug in ButtonBar.remove(Button) ?

30 Apr 2008, 6:05 AM

I'm having an issue regarding to the remove() method in the ButtonBar widget.
When I'm trying to remove a button, then I add another one instead, I'v got the following error message :

java.lang.IndexOutOfBoundsException: Index: 1, Size: 0In debug mode, I saw that after removing a button in the ButtonBar class, the button is not actually removed in the AbstractContainer.items List...

Is this a bug or something I've done wrong ?
Any help would be appreciated.

Thanks !

2 May 2008, 10:54 AM
The containers, including button bar, have been updated. The changes are only in SVN, and will go out in the next rev.

There is what button bar remove looks like now:

public boolean remove(Button button) {
boolean removed = super.remove(button);
if (removed) {
button.removeListener(Events.Select, listener);
button.removeListener(Events.BeforeSelect, listener);
return removed;

If you have problems after beta3, please post again to this thread.

2 May 2008, 1:24 PM
Okay, thx :)

20 May 2008, 7:53 AM
The bug is still there on beta3.
Here's the error log message :

[ERROR] component is not a child of this container
java.lang.RuntimeException: component is not a child of this container
at com.extjs.gxt.ui.client.widget.Container.remove(Container.java:414)
at com.extjs.gxt.ui.client.widget.Container.removeAll(Container.java:444)
at com.extjs.gxt.ui.client.widget.Container.removeAll(Container.java:198)...


20 May 2008, 11:41 AM
I tested and added unit tests to validate. Fix is in SVN.