Thursday, July 29, 2010

Protected Page + PopupPanel

I'm trying to have a popup login box show up instead of the real page
when the user is not yet logged in. The relevant code is below.

What happens, however, is that the popup panel shows up briefly and is
then overwritten with the DockLayoutPanel, even though I did not yet
add it to the RootPanel! In fact, I clear the RootPanel explicitely.

I am at a loss as to why this is happening. I'd love to hear your
suggestions and ideas. (Everything works as expected when the user is
logged in.)

(I'm using GWT 2.1.0.M2 and GWT-Platform 0.3.)

public class OtherView extends ViewImpl implements OtherPage.View {
  public interface UiBinder extends<DockLayoutPanel, OtherView> {

 private static final UiBinder UI = GWT.create(UiBinder.class);
 private final LoginBox        loginBox;
 private final DockLayoutPanel panel;
 private final User            user;
 HorizontalPanel               centre;

 public OtherView(final EventBus eventBus, final User user) {
   this.user = user;
   panel = UI.createAndBindUi(this);
   loginBox = new LoginBox(eventBus, user); // HTMLPanel

 public Widget asWidget() {
   return panel;

 public void refresh() {
   if (!user.isAuthenticated()) {
     final PopupPanel popupPanel = new PopupPanel();
     popupPanel.setSize("361px", "119px");
     popupPanel.setPopupPosition(456, 358);;
   } else {
     final Label loggedIn = new Label("Hi '" + user.getUserName() + "'!");

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment