Tuesday, May 31, 2016

Re: Getting username from url only works after refresh

The only issue I can see with the above code is that you have not implemented hashcode/equals for your places. However GWT expects you do implement both methods correctly for your places. I am still under the impression that it should just work, especially because you use placeController.goTo(new UserPlace(name)). In that case GWT does not parse the URL at all but only updates the URL in the browser based on the place you have created yourself in code.

Do you use UiBinder in your UserViewImpl? If yes then check if the widget that shows the user name has not been recreated accidentally, e.g. something like

UserViewImpl extends Composite {

  @UiField
  Label userNameLabel;

  public UserViewImpl() {
    initWidget(...);
    userNameLabel = new Label();
  }

  void setName(...) {
     userNameLabel.setText(...);
  }

}

will not work because the userNameLabel has been recreated manually in the constructor and is not attached in the browser UI at all.


-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment