Beispiel #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;
 }
Beispiel #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;
  }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #5
0
 public Set<Department> getDepartment() {
   return tag.getDepartmentTags();
 }
Beispiel #6
0
 public String addDepartment() {
   tag.getDepartmentTags().add(getSelectedDepartment());
   return NavigationResults.EDIT;
 }