I’m trying to catch an event, when I switch the stacks of a StackLayoutPanel in GWT 2.0.
The biggest problem is that I don’t know which event gets fired and there seems to be no documentation, I have added a ChangeHandler with addDomHandler() but that hasn’t worked.
Unfortunately the StackLayoutPanel doesn’t implement the getSelectedIndex()-function so I can’t just use an ClickEvent and then check if the selected index has changed.
Is my only solution to use the StackPanel or is there a way to get this to work with the StackLayoutPanel?
What I did, after some experiments: use a Label as the widget of the header with 100% width and then add a ClickEvent handler attached. Every time the ClickEvent arrives, it means the user clicked the header, so the panel will be visible…
Not very nice, but it worked.
I tried to wrap the header widget using a ClickWrapper (take a look to the StackLayoutPanel source code), but it didn’t worked, I dont know exactly why…