示例#1
0
  @GlobalCommand("showUserDetail")
  public void showUserDetail(@BindingParam("selectedUser") User user) {

    Map<String, Object> param = new HashMap<String, Object>();
    if (user != null && user.getId() != null) {
      param.put("selectedUser", user);
    }

    Window popupWin =
        (Window) Executions.createComponents("/widgets/modal/user-detail.zul", null, param);

    popupWin.doModal();
  }
示例#2
0
  @SuppressWarnings({"rawtypes", "unchecked"})
  @Command
  public void deleteUser(@BindingParam("selectedUser") User user) {

    this.selectedUser = user;

    Messagebox.show(
        "Are you sure to DELETE " + selectedUser.getUsername() + "?",
        "Confirm Dialog",
        Messagebox.OK | Messagebox.CANCEL,
        Messagebox.QUESTION,
        new org.zkoss.zk.ui.event.EventListener() {
          @Override
          public void onEvent(Event evt) throws InterruptedException {
            if (evt.getName().equals("onOK")) {
              service.remove(selectedUser);
              info("Successfully deleted");
              audit("Remove User:"******"refreshUserList", null);
            }
          }
        });
  }