예제 #1
0
 public void deleteCategoryAttribute() {
   categoryAttribute = categoryBean.findCategoryAttributeByID(id);
   categoryBean.removeCategoryAttribute(categoryAttribute);
   FacesContext.getCurrentInstance()
       .addMessage(
           "categoryAttributeList",
           new FacesMessage("CategoryAttribute " + categoryAttribute.getName() + " deleted."));
   this.categoryAttribute = new CategoryAttribute();
 }
예제 #2
0
 // Actions
 public void newCategoryAttribute() {
   categoryAttribute.setCategoryID(categoryBean.findCategoryByID(categoryid));
   categoryBean.addCategoryAttribute(categoryAttribute);
   FacesContext.getCurrentInstance()
       .addMessage(
           "newCategoryAttribute",
           new FacesMessage("CategoryAttribute " + categoryAttribute.getName() + " created."));
   this.categoryAttribute = new CategoryAttribute();
 }
예제 #3
0
 public void editCategoryAttribute() {
   categoryAttribute.setCategoryID(categoryBean.findCategoryByID(categoryid));
   //        System.out.println(categoryAttribute.getCategoryID());
   //        System.out.println(categoryAttribute.getCategoryAttributeID());
   //        System.out.println(categoryAttribute.getDescription());
   //        System.out.println(categoryAttribute.getName());
   categoryBean.updateCategoryAttribute(categoryAttribute);
   FacesContext.getCurrentInstance()
       .addMessage(
           "newCategoryAttribute",
           new FacesMessage("CategoryAttribute " + categoryAttribute.getName() + " edited."));
   this.categoryAttribute = new CategoryAttribute();
 }
예제 #4
0
 public ArrayList<SelectItem> getCategories() {
   categories.clear();
   List<Category> allCategory = categoryBean.findAllCategory();
   Iterator it = allCategory.iterator();
   while (it.hasNext()) {
     Category cat = (Category) it.next();
     SelectItem select = new SelectItem();
     select.setLabel(cat.getName());
     select.setValue(cat.getCategoryID());
     categories.add(select);
   }
   return categories;
 }
예제 #5
0
 public List<CategoryAttribute> getAllCategoryAttribute() {
   return categoryBean.findAllCategoryAttributes();
 }
예제 #6
0
 public void editCategoryAttributeSetup() {
   categoryAttribute = categoryBean.findCategoryAttributeByID(id);
 }