JOptionPane.showMessageDialog(
MDIFrame.getInstance(),
ClientSettings.getInstance().getResources().getResource("the selected item requires serial number definition: this kind of item is not allowed"),
ClientSettings.getInstance().getResources().getResource("Attention"),
JOptionPane.WARNING_MESSAGE);
ComponentVO compVO = (ComponentVO)parentVO;
compVO.setItemCodeItm01ITM03(null);
compVO.setDescriptionSYS10(null);
}
}
public void beforeLookupAction(ValueObject parentVO) {
ComponentVO vo = (ComponentVO)parentVO;
DetailItemVO itemVO = (DetailItemVO)ProductPanel.this.frame.getFormPanel().getVOModel().getValueObject();
colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,itemVO.getCompanyCodeSys01ITM01());
colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,itemVO.getCompanyCodeSys01ITM01());
colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHIE02());
colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHIE02());
colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, itemVO.getCompanyCodeSys01ITM01());
colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, itemVO.getCompanyCodeSys01ITM01());
colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,itemVO.getCompanyCodeSys01ITM01());
colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,itemVO.getCompanyCodeSys01ITM01());
}
public void forceValidate() {}
});
// alternative item code lookup for the alternative components grid...
colItemCode2DataLocator.setGridMethodName("loadItems");
colItemCode2DataLocator.setValidationMethodName("validateItemCode");
colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.COMPONENTS_ONLY,Boolean.TRUE);
colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPONENTS_ONLY,Boolean.TRUE);
colAltItemCode.setLookupController(colItemCode2Controller);
colItemCode2Controller.setLookupDataLocator(colItemCode2DataLocator);
colItemCode2Controller.setFrameTitle("components");
colItemCode2Controller.setCodeSelectionWindow(colItemCodeController.TREE_GRID_FRAME);
colTreeLevel2DataLocator.setServerMethodName("loadCompanyHierarchy");
colItemCode2DataLocator.setTreeDataLocator(colTreeLevel2DataLocator);
colItemCode2DataLocator.setNodeNameAttribute("descriptionSYS10");
colItemCode2Controller.setLookupValueObjectClassName("org.jallinone.items.java.GridItemVO");
colItemCode2Controller.addLookup2ParentLink("companyCodeSys01ITM01", "companyCodeSys01ITM04");
colItemCode2Controller.addLookup2ParentLink("itemCodeITM01", "itemCodeItm01ITM04");
colItemCode2Controller.addLookup2ParentLink("descriptionSYS10", "descriptionSYS10");
colItemCode2Controller.setAllColumnVisible(false);
colItemCode2Controller.setVisibleColumn("companyCodeSys01ITM01", true);
colItemCode2Controller.setVisibleColumn("itemCodeITM01", true);
colItemCode2Controller.setVisibleColumn("descriptionSYS10", true);
colItemCode2Controller.setPreferredWidthColumn("descriptionSYS10", 200);
colItemCode2Controller.setFramePreferedSize(new Dimension(650,500));
colItemCode2Controller.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
GridItemVO vo = (GridItemVO)colItemCode2Controller.getLookupVO();
DetailItemVO itemVO = (DetailItemVO)ProductPanel.this.frame.getFormPanel().getVOModel().getValueObject();
if (vo.getItemCodeITM01()!=null && vo.getItemCodeITM01().equals(itemVO.getItemCodeITM01())) {
JOptionPane.showMessageDialog(
MDIFrame.getInstance(),
ClientSettings.getInstance().getResources().getResource("you cannot set the current item as alternative component"),
ClientSettings.getInstance().getResources().getResource("Attention"),
JOptionPane.WARNING_MESSAGE);
AltComponentVO compVO = (AltComponentVO)parentVO;
compVO.setItemCodeItm01ITM04(null);
compVO.setDescriptionSYS10(null);
}
}
public void beforeLookupAction(ValueObject parentVO) {
DetailItemVO vo = (DetailItemVO)ProductPanel.this.frame.getFormPanel().getVOModel().getValueObject();
colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02ITM01());
colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02ITM01());
colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM01());
colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM01());
colTreeLevel2DataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHie02ITM01());
colTreeLevel2DataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHie02ITM01());
colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02ITM01());
colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02ITM01());
colTreeLevel2DataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, vo.getCompanyCodeSys01ITM01());
colTreeLevel2DataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, vo.getCompanyCodeSys01ITM01());
colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM01());
colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM01());
}
public void forceValidate() {}
});
// set explosion panel...
explosionPanel.setLoadWhenVisibile(false);
explosionPanel.setTreeController(new TreeController() {
public void doubleClick(DefaultMutableTreeNode node) {
MaterialVO vo = (MaterialVO)node.getUserObject();
new ItemController(null,new ItemPK(vo.getCompanyCodeSys01ITM03(),vo.getItemCodeItm01ITM03()),false);
}
public void leftClick(DefaultMutableTreeNode node) {}
public boolean rightClick(DefaultMutableTreeNode node) {