public void firstUnreadMessage(ActionEvent evt) { RequestContext ctx = RequestContext.getCurrentInstance(); Message m = mm.getFirstAfter(lastUpdate); ctx.addCallbackParam("ok", m != null); if (m == null) return; lastUpdate = m.getDateSent(); ctx.addCallbackParam("user", m.getUser()); ctx.addCallbackParam("dateSent", m.getDateSent().toString()); ctx.addCallbackParam("text", m.getMessage()); }
public void sendMessage(ActionEvent evt) { // if(connect()) mm.sendMessage(message); }