levelController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
CompanyHierarchyLevelVO vo = (CompanyHierarchyLevelVO)controlItemLevel.getLookupController().getLookupVO();
controlDescr.setText(vo==null?null:vo.getDescriptionSYS10());
progressiveHIE01 = vo==null?null:vo.getProgressiveHIE01();
}
public void beforeLookupAction(ValueObject parentVO) {
ItemTypeVO vo = (ItemTypeVO)itemTypesList.get(controlLOB.getSelectedIndex());
filterTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM02());
filterTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,controlLOB.getValue());
}
public void forceValidate() {}
});
// item code lookup...
itemDataLocator.setGridMethodName("loadItems");
itemDataLocator.setValidationMethodName("validateItemCode");
itemDataLocator.getLookupFrameParams().put(ApplicationConsts.SHOW_ONLY_MOVABLE_ITEMS,Boolean.TRUE);
itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.SHOW_ONLY_MOVABLE_ITEMS,Boolean.TRUE);
colItemCode.setLookupController(itemController);
itemController.setLookupDataLocator(itemDataLocator);
itemController.setFrameTitle("items");
itemController.setShowErrorMessage(false);
itemController.setCodeSelectionWindow(itemController.TREE_GRID_FRAME);
treeLevelDataLocator.setServerMethodName("loadCompanyHierarchy");
itemDataLocator.setTreeDataLocator(treeLevelDataLocator);
itemDataLocator.setNodeNameAttribute("descriptionSYS10");
itemController.setLookupValueObjectClassName("org.jallinone.items.java.GridItemVO");
itemController.addLookup2ParentLink("companyCodeSys01ITM01", "companyCodeSys01WAR07");
itemController.addLookup2ParentLink("itemCodeITM01", "itemCodeItm01WAR07");
itemController.addLookup2ParentLink("descriptionSYS10", "descriptionSYS10");
itemController.setAllColumnVisible(false);
itemController.setVisibleColumn("companyCodeSys01ITM01", true);
itemController.setVisibleColumn("itemCodeITM01", true);
itemController.setVisibleColumn("descriptionSYS10", true);
itemController.setPreferredWidthColumn("descriptionSYS10", 200);
itemController.setFramePreferedSize(new Dimension(650,500));
itemController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {}
public void beforeLookupAction(ValueObject parentVO) {
InventoryItemVO vo = (InventoryItemVO)parentVO;
vo.setCompanyCodeSys01WAR07(inventoryVO.getCompanyCodeSys01WAR06());
itemDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.SHOW_ITEMS_WITHOUT_VARIANTS,Boolean.TRUE);
itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.SHOW_ITEMS_WITHOUT_VARIANTS,Boolean.TRUE);
}
public void forceValidate() {}
});
// domain for locations...
HashMap map = new HashMap();
map.put(ApplicationConsts.COMPANY_CODE_SYS01,inventoryVO.getCompanyCodeSys01WAR06());
map.put(ApplicationConsts.PROGRESSIVE_HIE02,inventoryVO.getProgressiveHie02WAR01());
res = ClientUtils.getData("loadCompanyLeaves",map);
d = new Domain("WAR_LOCATIONS");
if (!res.isError()) {
java.util.List rows = null;
CompanyHierarchyLevelVO vo = null;
rows = ((VOListResponse)res).getRows();
for(int i=0;i<rows.size();i++) {
vo = (CompanyHierarchyLevelVO)rows.get(i);
d.addDomainPair(vo.getProgressiveHIE01(),vo.getDescriptionSYS10());
}
}
colProg.setDomain(d);
colRealProg.setDomain(d);