public List<Department> getDepartmentTags() { List<Department> departmentTags = new ArrayList<Department>(); if (tag.getDepartmentTags() != null && !tag.getDepartmentTags().isEmpty()) { departmentTags.addAll(tag.getDepartmentTags()); } return departmentTags; }
/** * 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; }
/** * 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; }
public String deleteDepartment() { final UIData table = (UIData) FacesUtils.getComponent("tag:departments"); final Department toDelete = (Department) table.getRowData(); tag.getDepartmentTags().remove(toDelete); return NavigationResults.EDIT; }
public Set<Department> getDepartment() { return tag.getDepartmentTags(); }
public String addDepartment() { tag.getDepartmentTags().add(getSelectedDepartment()); return NavigationResults.EDIT; }