google-code-export / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
1 stars 0 forks source link

PresenterWidget: passing null to addToPopupSlot() doesn't clear the popup slot #442

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>What steps will reproduce the problem?
1. show a popup on presenter A
2. close popup
3. switch to presenter B
4. then switch back to presenter A

>What is the expected output? What do you see instead?

We would expect that the popup is still hidden, but instead the popup is shown 
again without any user participation.

>What version of the product are you using? On what operating system?

0.7 / Windows 7 / Browser independent

>Please provide any additional information below.

What we do in our source code:
We have a Presenter wich shows a popup if the user clicks a button. In this 
"onButtonClick"-method we do something like this:

addToPopupSlot(ourPopup, true);
ourPopup.getView().setCloseHandler(new PopupViewCloseHandler() {
  public void onClose() {
      // do something usefull with the parent presenter here
  }
});
ourPopup.getView().show();

Because of this the popup doesn't have it's "default" PopupViewCloseHandler, 
which would usually remove the popup from the parents PopupChildren, anymore.

So we call "addToPopupSlot(null);" within the parent presenters "onHide()" to 
clear all previously added popups. The JavaDoc for the method 
"addToPopupSlot()" says:
[...]
Parameters:
child The popup child, a PresenterWidget. Passing null will clear the slot.
[...]

Unfortunately this doesn't work.

Original issue reported on code.google.com by bzieg...@washtec.de on 11 Oct 2012 at 12:23

GoogleCodeExporter commented 9 years ago
A new method removeFromPopupSlot has just been added to HasPopupSlot interface 
which should now do what you expect from addToPopupSlot method when passing 
null. It should be released with GWTP 1.0.

Original comment by bjoern.m...@gmail.com on 23 Mar 2013 at 6:33