예제 #1
0
 public List<Department> getDepartmentTags() {
   List<Department> departmentTags = new ArrayList<Department>();
   if (tag.getDepartmentTags() != null && !tag.getDepartmentTags().isEmpty()) {
     departmentTags.addAll(tag.getDepartmentTags());
   }
   return departmentTags;
 }
예제 #2
0
  /**
   * Create a new empty instance of the one-to-many field
   *
   * @return forward to the same page
   */
  public String editDepartmentTags() {
    Department item = new Department();

    if (tag.getDepartmentTags() == null) {
      tag.setDepartmentTags(new HashSet());
    }
    tag.getDepartmentTags().add(item);
    return null;
  }
예제 #3
0
 /**
  * Delete selected instance of the one-to-many field
  *
  * @return forward to the same page
  */
 public String deleteDepartmentTags() {
   UIData table = (UIData) FacesUtils.getComponent("tag:departmentTags");
   tag.getDepartmentTags().remove(table.getRowData());
   return null;
 }
예제 #4
0
 public String deleteDepartment() {
   final UIData table = (UIData) FacesUtils.getComponent("tag:departments");
   final Department toDelete = (Department) table.getRowData();
   tag.getDepartmentTags().remove(toDelete);
   return NavigationResults.EDIT;
 }
예제 #5
0
 public Set<Department> getDepartment() {
   return tag.getDepartmentTags();
 }
예제 #6
0
 public String addDepartment() {
   tag.getDepartmentTags().add(getSelectedDepartment());
   return NavigationResults.EDIT;
 }