supplierController.setPreferredWidthColumn("name_1REG04", 200);
supplierController.setPreferredWidthColumn("name_2REG04", 150);
supplierController.setFramePreferedSize(new Dimension(750,500));
supplierDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC06_ORDERS");
supplierDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC06_ORDERS");
supplierController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
DetailPurchaseDocVO vo = (DetailPurchaseDocVO)form.getVOModel().getValueObject();
if (vo.getSupplierCodePUR01()==null || vo.getSupplierCodePUR01().equals("")) {
// remove supplier pricelist code and currency code...
vo.setPricelistCodePur03DOC06(null);
vo.setPricelistDescriptionDOC06(null);
vo.setCurrencyCodeReg03DOC06(null);
}
else {
GridParams gridParams = new GridParams();
gridParams.getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC06());
gridParams.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveReg04DOC06());
Response res = ClientUtils.getData("loadSupplierPricelists",gridParams);
if (!res.isError()) {
java.util.List rows = ((VOListResponse)res).getRows();
if (rows.size()>0) {
SupplierPricelistVO pricelistVO = (SupplierPricelistVO)rows.get(0);
controlPricelistCode.setValue(pricelistVO.getPricelistCodePUR03());
pricelistController.forceValidate();
}
}
}
}
public void beforeLookupAction(ValueObject parentVO) {}
public void forceValidate() {}
});
// pricelist lookup...
pricelistDataLocator.setGridMethodName("loadSupplierPricelists");
pricelistDataLocator.setValidationMethodName("validateSupplierPricelistCode");
controlPricelistCode.setLookupController(pricelistController);
pricelistController.setLookupDataLocator(pricelistDataLocator);
pricelistController.setForm(form);
pricelistController.setFrameTitle("supplierPricelists");
pricelistController.setLookupValueObjectClassName("org.jallinone.purchases.pricelist.java.SupplierPricelistVO");
pricelistController.addLookup2ParentLink("pricelistCodePUR03","pricelistCodePur03DOC06");
pricelistController.addLookup2ParentLink("descriptionSYS10", "pricelistDescriptionDOC06");
pricelistController.addLookup2ParentLink("currencyCodeReg03PUR03","currencyCodeReg03DOC06");
pricelistController.setAllColumnVisible(false);
pricelistController.setVisibleColumn("pricelistCodePUR03", true);
pricelistController.setVisibleColumn("descriptionSYS10", true);
pricelistController.setVisibleColumn("currencyCodeReg03PUR03", true);
pricelistController.setPreferredWidthColumn("descriptionSYS10", 250);
pricelistController.setFramePreferedSize(new Dimension(420,500));
pricelistController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {}
public void beforeLookupAction(ValueObject parentVO) {
// retrieve function identifier...
Container c = PurchaseSupplierHeadPanel.this.getParent();
while (c != null && ! (c instanceof Form)) {
c = c.getParent();
}
if (c != null) {
Form form = (Form)c;
DetailPurchaseDocVO vo = (DetailPurchaseDocVO)form.getVOModel().getValueObject();
pricelistDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC06());
pricelistDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveReg04DOC06());
pricelistDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC06());
pricelistDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveReg04DOC06());
}
}
public void forceValidate() {}
});
// payment lookup...
payDataLocator.setGridMethodName("loadPayments");
payDataLocator.setValidationMethodName("validatePaymentCode");
controlPaymentCode.setLookupController(payController);
controlPaymentCode.setControllerMethodName("getPaymentsList");
payController.setForm(form);
payController.setLookupDataLocator(payDataLocator);
payController.setFrameTitle("payments");
payController.setLookupValueObjectClassName("org.jallinone.registers.payments.java.PaymentVO");
payController.addLookup2ParentLink("paymentCodeREG10", "paymentCodeReg10DOC06");
payController.addLookup2ParentLink("descriptionSYS10","paymentDescriptionDOC06");
payController.setAllColumnVisible(false);
payController.setVisibleColumn("paymentCodeREG10", true);
payController.setVisibleColumn("descriptionSYS10", true);
payController.setPreferredWidthColumn("descriptionSYS10", 250);
payController.setFramePreferedSize(new Dimension(350,500));
payController.addLookupListener(new LookupListener() {
public void beforeLookupAction(org.openswing.swing.message.receive.java.ValueObject parentVO) {
DetailPurchaseDocVO vo = (DetailPurchaseDocVO)form.getVOModel().getValueObject();
payDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC06());
payDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC06());