I found what works in IE, and does not break hosted mode, Firefox 3.5,
or Safari 4:  Do NOT try to hide/show my application DIV or put my
widget into it.  Hide the LOGIN_DIV as show, but put the
MainWindowWidget in the default root panel.  So

private static void doLogin() {
        ...
        logonPanel.setVisible(false);
        RootPanel.get().add(new MainWindowWidget());
        ...
}

Returning to the login is now just

        public static void showLoginDiv() {
                RootPanel.get().clear();
                RootPanel logonPanel = RootPanel.get(Workstation.LOGIN_DIV);
                logonPanel.setVisible(true);
        }

I was afraid this would break some things in my application, like a
DIV in which I occasionally open an IFRAME for downloading various
files from the server.  However that still works fine.

Thanks for the help.

Now on to History.

On Sep 2, 1:54 pm, Thad <[email protected]> wrote:
> On Sep 1, 6:30 pm, Thomas Broyer <[email protected]> wrote:
>
> > On 2 sep, 00:16, Thad <[email protected]> wrote:
> ...
> > > Right now I'm having bigger problems trying to do things 
> > > byhttp://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecur...
> > > ...
>
> > From the comments on that 
> > page:http://groups.google.fr/group/Google-Web-Toolkit/t/2b2ce0b6aaa82461
>
> I've followed the link above.  What I have works excellently in hosted
> mode, as well as in Firefox 3.5, and Safari 4--the browser's password
> manager is triggered, and the user is logged in.  However I've still
> no luck with IE7 (and no Javascript error indicated).
>
> Does IE have a problem with hiding/showing DIV's?  The form behaves
> properly.  injectLoginFunction() works (see below), the doLogin()
> method is called, and the user logged in (so says my server's
> console).  As you see below, on a successful login, the LOGIN_DIV in
> the original panel is hidden, the APPLICATION_DIV is made visible, and
> the application's MainWindowWidget is created and added to the
> APPLICATION_DIV.  (After a user logs off the server, the showLoginDiv
> () method is called, and we start over.)
>
> As I said, this works in hosted mode, Firefox 3.5, and Safari 4.  In
> IE, after the login completes, all I see is a blank browser, and
> "Done" in the lower left message area (no JS error).
>
> Is there another way to handle this that will work with IE?
>
> private static native void injectLoginFunction() /*-{
>         $wnd.__gwt_login = function() {
>                 @com.mycorp.web.client.Workstation::doLogin()();
>         };
>
> }-*/;
>
> @SuppressWarnings("unused")
> private static void doLogin() {
>         final RootPanel applPanel = RootPanel.get
> (Workstation.APPLICATION_DIV);
>         final RootPanel logonPanel = RootPanel.get(Workstation.LOGIN_DIV);
>         AsyncCallback<LoginInfo> callback = new AsyncCallback<LoginInfo>() {
>                 public void onSuccess(LoginInformation result) {
>                         Workstation.setLoginInfo(result);
>                         logonPanel.setVisible(false);
>                         applPanel.setVisible(true);
>                         MainWindowWidget mw = new MainWindowWidget();
>                         applPanel.add(mw);
>                 }
>                 public void onFailure(Throwable caught) {
>                         if 
> (caught.getMessage().contains("java.net.ConnectException"))
>                                 Window.alert("Cannot connect to server.\n"+
>                                                 "Server name or RPC number 
> invalid.");
>                         else
>                                 Window.alert(caught.getMessage());
>                 }
>         };
>
>         String name = ((InputElement)Document.get().getElementById
> ("username")).getValue();
>         String pw = ((InputElement)Document.get().getElementById
> ("password")).getValue();
>         String svr = ((InputElement)Document.get().getElementById
> ("server")).getValue();
>         ClientInfo ci = new ClientInfo();
>         LiloServicesAsync service = (LiloServicesAsync) GWT.create
> (LiloServices.class);
>         service.doLogin(name, pw, svr, ci, callback);
>
> }
>
> public static void showLoginDiv() {
>         RootPanel applPanel = RootPanel.get(Workstation.APPLICATION_DIV);
>         applPanel.clear();
>         applPanel.setVisible(false);
>         RootPanel logonPanel = RootPanel.get(Workstation.LOGIN_DIV);
>         logonPanel.setVisible(true);
>
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to