コード例 #1
0
  public ProfileDataModel getModel() {
    if (model == null) {
      list = tablesService.getListProfile();
      model = new ProfileDataModel(list);

      if (list.size() > 0) {
        selected = list.get(0);
      }
    }
    return model;
  }
コード例 #2
0
  public void saveAction() {
    String message = null;

    int result = tablesService.saveProfile(selected);
    if (result == 0) {
      list = tablesService.getListProfile();
      model = new ProfileDataModel(list);
      message = FacesUtil.getMessage("msg_record_ok");
      FacesUtil.addInfo(message);
    } else if (result == -1) {
      String paramValue = FacesUtil.getMessage("pro_code");
      message = FacesUtil.getMessage("msg_record_unique_exception", paramValue);
      FacesUtil.addError(message);
    }
  }