@Override protected PackageLine loadForCreate(Map<String, Object> request) { PackageLine entity = super.loadForCreate(request); entity.setPackage((SPackage) getParentObject()); entity.setProduct((Product) request.get(ListPackageLineView.PRODUCT_OF_PACKAGE_LINE)); return entity; }
@Override protected void setReferenceDataModel(ReferenceDataModel refDataModel, PackageLine entity) { super.setReferenceDataModel(refDataModel, entity); DetachedCriteria dc = daoHelper.getDao(Item.class).getCriteria(); dc.add(Restrictions.eq("product", entity.getProduct())); refDataModel.putRefDataList(REF_ITEMS, daoHelper.getDao(Item.class).findByCriteria(dc)); }
/** {@inheritDoc} */ @Override protected void initialPresentationView( DetailDataModel detailDataModel, PackageLine entity, Map<String, Object> request) { detailDataModel.addRawAttribute("product", DetailFieldType.TEXTBOX).value(entity.getProduct()); detailDataModel.addAttribute("optional", DetailFieldType.CHECKBOX); detailDataModel.addAttribute("isAllItem", DetailFieldType.CHECKBOX); detailDataModel.addAttribute("minItemAmount", DetailFieldType.TEXTBOX); detailDataModel.addAttribute("maxItemAmount", DetailFieldType.TEXTBOX); detailDataModel .addAttribute("explicitLinkItems", DetailFieldType.MULTI_SELECT_LIST_BOX) .referenceDataId(REF_ITEMS); detailDataModel .addAttribute("itemPrices", DetailFieldType.LIST) .componentInfo(createListPLItemPriceElementInfo(entity)); }
@Override protected String getDefaultTitle(PackageLine entity) { return ControlConfigUtils.getString("JTree.SubMenu.Package.PackageLine") + " - " + (entity.getId() != null ? entity.getId() : "New"); }