@UiHandler("createNewPostBtn") void createNewPost(ClickEvent event) { String userId = utils.retrUserId(); String projectId = utils.retrFromState("projectId"); String title = newPostTtlTextBox.getText(); utils.showStaticMessage(messages.showSentRequestMsg(utils.retrFromState("projectName"))); try { service.createNewPost( projectId, userId, title, new AsyncCallback<JSONValue>() { @Override public void onSuccess(JSONValue result) { Log.debug(result.toString()); utils.dismissStaticMessage(); utils.showSuccessMessage(constants.successStr(), 3); } @Override public void onFailure(Throwable caught) { utils.dismissStaticMessage(); utils.alert(caught.getMessage()); } }); } catch (RequestException e) { Log.error("error in createNewPost", e); } utils.reportEvent("/newpost/", "createNewPost", projectId, 1); }
public void setForumInfoIntoGadget(final MessagesImpl messages, final VegaUtils utils) { aboutNewPostLbl.setText(messages.aboutUseNewPostGadgetMsg(utils.retrFromState("projectName"))); helloUserLbl.setText(messages.helloMsg(utils.retrUserName())); }