private static UserInfo userInfo;
public UserPanel() {
container = new MaterialContainer(); container.setFontSize("1em");
setUserInfo("someUsername");
Widget mainMenu = createMenu();
initWidget(mainMenu);}
public void setUserInfo(String username) { DBGetUserInfoAsync rpcService = (DBGetUserInfoAsync) GWT.create(DBGetUserInfo.class); ServiceDefTarget target = (ServiceDefTarget) rpcService; String moduleRelativeURL = GWT.getModuleBaseURL() + "DBGetUserInfoImpl"; target.setServiceEntryPoint(moduleRelativeURL);
rpcService.getUserInfo(username, new AsyncCallback<UserInfo>() {
@Override public void onSuccess(UserInfo result) { UserPanel.userInfo = result; }
@Override public void onFailure(Throwable caught) { // Window.alert(caught.getMessage()); } });}
Widget mainMenu = createMenu();
initWidget(mainMenu);
rpcService.getUserInfo(username, new AsyncCallback<UserInfo>() {
@Override
public void onSuccess(UserInfo result) {
UserPanel.userInfo = result;
Widget mainMenu = createMenu();
initWidget(mainMenu);
}
@Override
public void onFailure(Throwable caught) {
// Window.alert(caught.getMessage());
}
});
private void setMenu(UserInfo userInfo) {
label.setName(userInfo.getName());
}
--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/28B788mIbEU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@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.
public class UserPanel extends Composite implements UserView {
private MaterialContainer container;
private Presenter presenter;
private String username;
...
public UserPanel() { container = new MaterialContainer(); container.setFontSize("1em");
Widget mainMenu = createMenu(); initWidget(mainMenu);
}
...
@Override public void setUsername(String username) { this.username = username; Window.alert(username); }
@Override public void setPresenter(Presenter presenter) { this.presenter = presenter; }