コード例 #1
0
  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());
  }
コード例 #2
0
 public void sendMessage(ActionEvent evt) {
   // if(connect())
   mm.sendMessage(message);
 }