public void onChange(ChangeEvent event) { statusDirty = true; String str = statusText.getText(); if (str.length() > 140) { // truncate if too long statusText.setText(str.substring(0, 140) + "..."); } }
public boolean dialogClosing(DialogBox dialog) { // save status if any change statusText.setFocus(false); if (statusDirty && userUid != null) { SecurityControllerAsync securityController = ControllerFactory.getSecurityController(); // give -1 to get current login user securityController.saveUserStatus( userUid, statusText.getText(), new AsyncCallback<Boolean>() { public void onFailure(Throwable caught) {} public void onSuccess(Boolean result) {} }); } return true; }