Strange exception while using Accordion

Hi !

Yes, it’s me again ^^’
This time, for a change, I’ve got a little problem with an Accordion component.
The problem seems to come from my code, but I just can’t see what I’m doing wrong.

I use an Accordion component, with two tabs, each containing a very similar and quite complex OrderedLayout (containing itself an hierarchy of CustomLayout, half a dozen buttons, and a few other things).

The Accordion display without any problem.
When I click on the caption, to display the hidden section, it display fine. When I click again on the first, it STILL display fine.
But if I try a third time, clicking one more time on the caption… I got an exception that I’m not able to catch - I’m not even sure of where it is thrown.
But nothing display, and Firebug show me in the console the following exception:
uncaught exception: java.lang.IllegalStateException: Should only call onDetach when the widget is attached to the browser’s document

Of course, I’ve tried in another application to use a really simple Accordion, and it work perfectly fine.
I’m not able to reproduce the bug outside my main application, even if I try to use a similar complex architecture.

When I simplify the said architecture on my main application, the problem solve itself - but, hey, I do need all those things ^^

So…
Does anyone have an idea on where I should look, to find the source of this error ? I personnaly never call onDetach(), nor do anything specific on requestRepaint() on those components. I’m really at loss on that one :frowning:

Quentin.

Good morning Quentin!

This definitely sounds like client side bug of some sort. Opening the other tab fails due some exception. I’m guessing that some component inside the first tab has problems to detach it self form DOM properly, but it is just a guess.

When using Toolkit one should never face this kind of problems, but the world is not perfect… yet. To get a clue on what is happening here it is easiest for launch GWT hosted mode browser for debugging the client side code. Firebug only shows a fraction of errors and their details what is happening in GWT code. With hosted mode browser you will then most likely get some errors on java console already on the first click.

BTW, What version are you using?

cheers,
matti

I’m using a custom build of the toolkit (integrating the patch I’ve done some time back, to add the CellStyleGenerator to the Table component), based on the 5.2.4 version.

What I can’t understand is the source of that one. Ok, what is in my tab is quite complex - but “complex” as in “there is many simple elements”.
I’ll try to launch the app in hosted mode… As I do not even have an Eclipse installed on my computer, that
may
prove to be a little bit complicated, but eh :smiley:

Quentin.

Hosted mode browsers is not tied into eclipse, but too bad most instructions for configuring it are for eclipse based environments. If you manage to get it working on your environment (NetBeans ?) feel free to add simple instructions to wiki.

If your code is simple you might be able to reduce it and post it here for more deeper investigation.

Good luck!

Hi,

Just to clarify one thing for anyone that happens to read this: this exception is happening client side (in GWT running in the browser).

If you’re not using any customized (client-side/GWT) components (are you?), a wild guess would be that there is a bug in either accordion or customlayout…

Would it be easy for you to try which component causes the problem (change accordion to tabsheet, change customlayout to some other etc)? Otherwise I can try to reproduce the problem here…

Best Regards,
Marc