0

I'm new in programming gwtp and have a problem using the popupslot: I have several nested presenters. One presenter reveals a popup dialog. Every time, when this presenter is revealed, the popup dialog is shown - incl. the last field values.

How can I clear the PopupSlot?

stoi
  • 61
  • 1
  • 6

2 Answers2

2

In order to hide a popup dialog, you must call popupView.hide(). If you want the popup to be cleared the next time it pops up, you must clear the form fields before calling the hide() method.

spg
  • 9,309
  • 4
  • 36
  • 41
0

As I understand you have presenter A that add PresenterWidget B to popup slot. Every time Presenter A is revealed PresenterWidget B revealed too.

The reason of such behavior is that you add PreseneterWidget B to popup slot on one of life-cycle method. Check your onReveal and prepareFromRequest methods. They are called every time your presenter becomes visible. May be you should add some condition or move addToPopupSlot call to other place.

Kirill Lebedev
  • 650
  • 4
  • 9
  • I have the follwing code inserted in the presenter A onBind()-Method: getView().getAnchorLogin().addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { addToPopupSlot(loginPresenter); } }); – stoi Oct 08 '12 at 14:44
  • It looks good and should not cause your problem. Can you share onReveal and prepareFromRequest. – Kirill Lebedev Oct 08 '12 at 17:32