PDA

View Full Version : FormPanel "Show" event no longer fires after upgrading to 2.2.5



playalpha
10 Jan 2012, 3:25 PM
I have tried every possible permutation of the following and I need some help. This all used to work until I upgraded.

MyFormPanel(){

addListener(Events.Show, new Listener<BaseEvent>() {

@Override
public void handleEvent(BaseEvent be) {
Window.alert("show");
}
});

}

I tried overriding onShow() as well as adding the listener in onRender(). Nothing happens.

sven
11 Jan 2012, 11:07 AM
What are you trying to do? The show event fires after you call the show method.

playalpha
11 Jan 2012, 1:18 PM
I have a requirement to make the FormPanel fields behave as though they were Web 1.0 and clear if you show-hide-show the form.

Previously, Observable was invoking my onShow() method every time the form was shown, and I could just call clear() as below and it would work as expected. Now this no longer happens, my handler is never invoked.

@Override
protected void onShow() {
super.onShow();
clear();
}

playalpha
13 Jan 2012, 1:36 PM
What are you trying to do? The show event fires after you call the show method.

Hi Sven, does the framework not invoke onShow() automatically when FormPanel is shown? Do I misunderstand? It sounds like you're saying I need to call it in my code. If so, how would I add a handler to be notified when this happens?

playalpha
16 Jan 2012, 2:48 PM
Hi Sven, does the framework not invoke onShow() automatically when FormPanel is shown? Do I misunderstand? It sounds like you're saying I need to call it in my code. If so, how would I add a handler to be notified when this happens?

Any ideas?

playalpha
1 Feb 2012, 1:28 PM
bump

sven
1 Feb 2012, 2:02 PM
The framework only calls onShow when you really call the show method. Not when you simple add the Component to the DOM.

Do you have a fully working testcaes implementing EntryPoint that shows exactly what you are doing?

playalpha
13 Feb 2012, 11:42 AM
Hm, I tried this with a fresh project and it appears to work correctly. In my existing large application (~20k lines of code) it is not working anymore.

Any help on common pitfalls in this area would be appreciated.

Thanks,
-Clinton