public void materialComboBoxSelected() { try { selectedMaterial = matController.getMaterial(selectedMaterialID); editGRItem.setMaterial(selectedMaterial); if (selectedMaterial != null) { editGRItem.setReceiveUnit(selectedMaterial.getOrderUnit()); editGRItem.setUnitPrice(selectedMaterial.getOrderUnitPrice()); } } catch (ControllerException e) { FacesUtils.reportError(FacesContext.getCurrentInstance(), e.getMessage(), e.getMessage(), e); e.printStackTrace(); } }
private void createMaterialSelectItem() { try { ArrayList<Material> matList = matController.getMaterials(selectedMaterialGroup); materialSelectItemList.clear(); materialSelectItemList.add(new SelectItem(Long.valueOf(-1), "àÅ×Í¡ÇÑÊ´Ø")); SelectItem selectItem; for (Material material : matList) { selectItem = new SelectItem(material.getId(), material.toString()); materialSelectItemList.add(selectItem); } } catch (ControllerException e) { e.printStackTrace(); FacesUtils.reportError(FacesContext.getCurrentInstance(), e.getMessage(), e.getMessage(), e); } }