}
}
/** Send a chat message to the server. */
private void sendMessageToServer() { // (20)
ChatMessage chatmsg = new ChatMessage(getUser(), messageBox
.getText(), getCurrentChat());
messageBox.setText("");
chatService.postMessage(chatmsg,
new AsyncCallback<List<ChatMessage>>() {
public void onFailure(Throwable caught) {
PersistChat.this.addNewMessage(new ChatMessage(
"System", "Error sending message: "
+ caught.getMessage(),
getCurrentChat()));
}