Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Window.Location.assign(url) does not work with Chrome

    I use GWT Window in smartGWT to try to load another url:

    Window.Location.assign(url);

    it is working with firefox, but not with Chrome (10.0.648.205).

    Is this a bug? Any workaround for that?

    #2
    I have just tried the following code and it works both in FF and Chrome.

    Code:
    package com.example.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.Window;
    
    public class WindowLocationAssignTest implements EntryPoint {
        
        @Override
        public void onModuleLoad() {
        	Window.Location.assign("http://www.google.com");
        }
    }
    Can you post a code sample and the version of SmartGWT you are using?

    Comment


      #3
      I use smartgwt-2.2.

      I use relative path like:

      Window.Location.assign("/anotherpage.html");

      Did you try relative path and is it also working?

      Comment


        #4
        I checked the relative path on SmartGWT2.4 and SmartGWT2.2 on Firefox 3.6.16 and Chrome 11.0.696.57 and it works ok. Are you sure that it is the call to Window.Location.assign that is not working?

        Feel free to post the code sample.

        Comment


          #5
          What I'm doing is: catch the browser closing event, in the event handler, assign to a url, which will send a request to server, so the server will know that the user is logging out so it will remove the user from session (we keep the user id in session while it logs in).

          Code snippet:


          Window.addWindowClosingHandler(new Window.ClosingHandler() {
          @Override
          public void onWindowClosing(ClosingEvent event) {
          Window.Location.assign(logoutLink);

          }
          });

          This works with Firefox, but not Chrome.

          Then, what would be a way to send a request to server in this case?

          Comment


            #6
            just to clarify, the session mentioned above is our own session cache, not http session.

            Comment

            Working...
            X