Package org.openswing.swing.lookup.client

Examples of org.openswing.swing.lookup.client.LookupListener


      eAccountController.setFramePreferedSize(new Dimension(400,400));
      eAccountController.setAllColumnVisible(false);
      eAccountController.setVisibleColumn("accountCodeACC02",true);
      eAccountController.setVisibleColumn("descriptionSYS10",true);
      eAccountController.setPreferredWidthColumn("descriptionSYS10",290);
      eAccountController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO vo = (AccountVO)eAccountController.getLookupVO();
          controlECode.setValue(vo.getAccountCodeACC02());
          controlEDescr.setValue(vo.getDescriptionSYS10());
        }

        public void beforeLookupAction(ValueObject parentVO) {
          eAccountDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          eAccountDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
        }

        public void forceValidate() {}

      });


      // loss/profit to patrim. endorsing account code lookup...
      controlPCode.setLookupController(pAccountController);
      controlPCode.setControllerMethodName("getAccounts");
      pAccountController.setLookupDataLocator(pAccountDataLocator);
      pAccountDataLocator.setGridMethodName("loadAccounts");
      pAccountDataLocator.setValidationMethodName("validateAccountCode");
      pAccountController.setFrameTitle("accounts");
      pAccountController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
//      pAccountController.addLookup2ParentLink("accountCodeACC02", "accountCodeACC02");
//      pAccountController.addLookup2ParentLink("descriptionSYS10","descriptionSYS10");
      pAccountController.setFramePreferedSize(new Dimension(400,400));
      pAccountController.setAllColumnVisible(false);
      pAccountController.setVisibleColumn("accountCodeACC02",true);
      pAccountController.setVisibleColumn("descriptionSYS10",true);
      pAccountController.setPreferredWidthColumn("descriptionSYS10",290);
      pAccountController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO vo = (AccountVO)pAccountController.getLookupVO();
          controlPCode.setValue(vo.getAccountCodeACC02());
          controlPDescr.setValue(vo.getDescriptionSYS10());
        }

        public void beforeLookupAction(ValueObject parentVO) {
          pAccountDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          pAccountDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
        }

        public void forceValidate() {}

      });


      // closing patrim. accounts lookup...
      controlCCode.setLookupController(cAccountController);
      controlCCode.setControllerMethodName("getAccounts");
      cAccountController.setLookupDataLocator(cAccountDataLocator);
      cAccountDataLocator.setGridMethodName("loadAccounts");
      cAccountDataLocator.setValidationMethodName("validateAccountCode");
      cAccountController.setFrameTitle("accounts");
      cAccountController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
//      cAccountController.addLookup2ParentLink("accountCodeACC02", "accountCodeACC02");
//      cAccountController.addLookup2ParentLink("descriptionSYS10","descriptionSYS10");
      cAccountController.setFramePreferedSize(new Dimension(400,400));
      cAccountController.setAllColumnVisible(false);
      cAccountController.setVisibleColumn("accountCodeACC02",true);
      cAccountController.setVisibleColumn("descriptionSYS10",true);
      cAccountController.setPreferredWidthColumn("descriptionSYS10",290);
      cAccountController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO vo = (AccountVO)cAccountController.getLookupVO();
View Full Code Here


      oAccountController.setFramePreferedSize(new Dimension(400,400));
      oAccountController.setAllColumnVisible(false);
      oAccountController.setVisibleColumn("accountCodeACC02",true);
      oAccountController.setVisibleColumn("descriptionSYS10",true);
      oAccountController.setPreferredWidthColumn("descriptionSYS10",290);
      oAccountController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO vo = (AccountVO)oAccountController.getLookupVO();
View Full Code Here

    empController.setVisibleColumn("name_1REG04", true);
    empController.setVisibleColumn("name_2REG04", true);
    empController.setPreferredWidthColumn("name_1REG04",150);
    empController.setPreferredWidthColumn("name_2REG04",150);
    empController.setFramePreferedSize(new Dimension(430,400));
    empController.addLookupListener(new LookupListener() {

      /**
       * Method called when lookup code is validated and when code is selected on lookup grid frame.
       * @param validated <code>true</code> if lookup code is correclty validated, <code>false</code> otherwise
       */
      public void codeValidated(boolean validated) {}


      /**
       * Method called when lookup code is changed (also when is set to "" or null)
       * @param parentVO lookup container v.o.
       * @param parentChangedAttributes lookup container v.o. attributes
       */
      public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
        GridEmployeeVO vo = (GridEmployeeVO)empController.getLookupVO();
        controlEmpName_1.setValue(vo.getName_1REG04());
        controlEmpName_2.setValue(vo.getName_2REG04());
        controlManagerCode.setValue(vo.getEmployeeCodeSCH01());
        progressiveManagerREG04 = vo.getProgressiveReg04SCH01();
      }


      /**
       * Method called before code validation and on lookup button click.
       */
      public void beforeLookupAction(ValueObject parentVO) {}


      /**
       * Validation is forced.
       */
      public void forceValidate() {}

    });

      // people lookup...
    peopleDataLocator.setGridMethodName("loadSubjectPerName");
    peopleDataLocator.setValidationMethodName("");
    filterPeopleButton.setLookupController(peopleController);
    peopleController.setLookupDataLocator(peopleDataLocator);
    peopleController.setFrameTitle("people");
    peopleController.setLookupValueObjectClassName("org.jallinone.subjects.java.PeopleVO");
//    peopleController.addLookup2ParentLink("progressiveREG04","progressiveReg04SubjectSCH06");
//    peopleController.addLookup2ParentLink("name_1REG04","subjectName_1SCH06");
//    peopleController.addLookup2ParentLink("name_2REG04","subjectName_2SCH06");
    peopleController.setAllColumnVisible(false);
    peopleController.setVisibleColumn("name_1REG04", true);
    peopleController.setVisibleColumn("name_2REG04", true);
    peopleController.setVisibleColumn("addressREG04", true);
    peopleController.setVisibleColumn("cityREG04", true);
    peopleController.setVisibleColumn("provinceREG04", true);
    peopleController.setVisibleColumn("countryREG04", true);
    peopleController.setVisibleColumn("zipREG04", true);
    peopleController.setHeaderColumnName("addressREG04", "address");
    peopleController.setHeaderColumnName("cityREG04", "city");
    peopleController.setHeaderColumnName("provinceREG04", "prov");
    peopleController.setHeaderColumnName("countryREG04", "country");
    peopleController.setHeaderColumnName("zipREG04", "zip");
    peopleController.setPreferredWidthColumn("name_1REG04", 120);
    peopleController.setPreferredWidthColumn("name_2REG04", 120);
    peopleController.setPreferredWidthColumn("addressREG04", 200);
    peopleController.setPreferredWidthColumn("provinceREG04", 50);
    peopleController.setPreferredWidthColumn("countryREG04", 70);
    peopleController.setPreferredWidthColumn("zipREG04", 50);
    peopleController.setFramePreferedSize(new Dimension(740,500));
    peopleController.addLookupListener(new LookupListener() {

      public void codeValidated(boolean validated) {}

      public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
        PeopleVO vo = (PeopleVO)peopleController.getLookupVO();
        controlName_1.setValue(vo.getName_1REG04());
        controlName_2.setValue(vo.getName_2REG04());
        filterPeopleButton.setValue(vo.getProgressiveREG04());
      }

      public void beforeLookupAction(ValueObject parentVO) {
//        peopleDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,empVO.getCompanyCodeSys01REG04());
        peopleDataLocator.getLookupFrameParams().put(ApplicationConsts.SUBJECT_TYPE,ApplicationConsts.SUBJECT_PEOPLE);
      }

      public void forceValidate() {}

    });


    // organization lookup...
    orgDataLocator.setGridMethodName("loadSubjectPerName");
    orgDataLocator.setValidationMethodName("");
    filterOrgButton.setLookupController(orgController);
    orgController.setLookupDataLocator(orgDataLocator);
    orgController.setFrameTitle("organizations");
    orgController.setLookupValueObjectClassName("org.jallinone.subjects.java.OrganizationVO");
//    orgController.addLookup2ParentLink("progressiveREG04","progressiveReg04SubjectSCH06");
//    orgController.addLookup2ParentLink("name_1REG04","subjectName_1SCH06");
//    orgController.addLookup2ParentLink("name_2REG04","subjectName_2SCH06");
    orgController.setAllColumnVisible(false);
    orgController.setVisibleColumn("name_1REG04", true);
    orgController.setVisibleColumn("addressREG04", true);
    orgController.setVisibleColumn("cityREG04", true);
    orgController.setVisibleColumn("provinceREG04", true);
    orgController.setVisibleColumn("countryREG04", true);
    orgController.setVisibleColumn("zipREG04", true);
    orgController.setHeaderColumnName("addressREG04", "address");
    orgController.setHeaderColumnName("cityREG04", "city");
    orgController.setHeaderColumnName("provinceREG04", "prov");
    orgController.setHeaderColumnName("countryREG04", "country");
    orgController.setHeaderColumnName("zipREG04", "zip");
    orgController.setPreferredWidthColumn("name_1REG04", 150);
    orgController.setPreferredWidthColumn("addressREG04", 200);
    orgController.setPreferredWidthColumn("provinceREG04", 50);
    orgController.setPreferredWidthColumn("zipREG04", 50);
    orgController.setFramePreferedSize(new Dimension(740,500));
    orgController.addLookupListener(new LookupListener() {

      public void codeValidated(boolean validated) {}

      public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
        OrganizationVO vo = (OrganizationVO)orgController.getLookupVO();
View Full Code Here

      posController.setAllowTreeLeafSelectionOnly(false);
      posController.setLookupValueObjectClassName("org.jallinone.hierarchies.java.HierarchyLevelVO");
      posController.addLookup2ParentLink("progressiveHIE01", "progressiveHie03SYS18");
      posController.addLookup2ParentLink("descriptionSYS10","levelDescriptionSYS10");
      posController.setFramePreferedSize(new Dimension(400,400));
      posController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) { }
View Full Code Here

      startAccountController.setFramePreferedSize(new Dimension(400,400));
      startAccountController.setAllColumnVisible(false);
      startAccountController.setVisibleColumn("accountCodeACC02",true);
      startAccountController.setVisibleColumn("descriptionSYS10",true);
      startAccountController.setPreferredWidthColumn("descriptionSYS10",290);
      startAccountController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
//          AccountVO vo = (AccountVO)startAccountController.getLookupVO();
//          controlStartAccount.setValue(vo.getAccountCodeACC02());
//          controlStartAccountDescr.setValue(vo.getDescriptionSYS10());
        }

        public void beforeLookupAction(ValueObject parentVO) {
          startAccountDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          startAccountDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
        }

        public void forceValidate() {}

      });


      // end account code lookup...
      controlEndAccount.setLookupController(endAccountController);
      controlEndAccount.setControllerMethodName("getAccounts");
      endAccountController.setLookupDataLocator(endAccountDataLocator);
      endAccountDataLocator.setGridMethodName("loadAccounts");
      endAccountDataLocator.setValidationMethodName("validateAccountCode");
      endAccountController.setFrameTitle("accounts");
      endAccountController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
      endAccountController.addLookup2ParentLink("accountCodeACC02", "accountCodeACC02");
      endAccountController.addLookup2ParentLink("descriptionSYS10","descriptionSYS10");
      endAccountController.setFramePreferedSize(new Dimension(400,400));
      endAccountController.setAllColumnVisible(false);
      endAccountController.setVisibleColumn("accountCodeACC02",true);
      endAccountController.setVisibleColumn("descriptionSYS10",true);
      endAccountController.setPreferredWidthColumn("descriptionSYS10",290);
      endAccountController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
//          AccountVO vo = (AccountVO)endAccountController.getLookupVO();
View Full Code Here

      motiveController.setFramePreferedSize(new Dimension(400,400));
      motiveController.setAllColumnVisible(false);
      motiveController.setVisibleColumn("accountingMotiveCodeACC03",true);
      motiveController.setVisibleColumn("descriptionSYS10",true);
      motiveController.setPreferredWidthColumn("descriptionSYS10",290);
      motiveController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
        }

        public void beforeLookupAction(ValueObject parentVO) {
          motiveDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          motiveDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
        }

        public void forceValidate() {}

      });


      // register code lookup...
      controlRegCode.setLookupController(regController);
      controlRegCode.setControllerMethodName("getVatRegisters");
      regController.setForm(headerPanel);
      regController.setLookupDataLocator(regDataLocator);
      regDataLocator.setGridMethodName("loadVatRegisters");
      regDataLocator.setValidationMethodName("validateVatRegisterCode");
      regController.setFrameTitle("vat registers");
      regController.setLookupValueObjectClassName("org.jallinone.accounting.vatregisters.java.VatRegisterVO");
      regController.addLookup2ParentLink("registerCodeACC04", "registerCodeACC04");
      regController.addLookup2ParentLink("descriptionSYS10","registerDescriptionACC04");
      regController.addLookup2ParentLink("accountCodeAcc02ACC04","accountCodeAcc02ACC04");
      regController.addLookup2ParentLink("accountDescriptionACC04","accountDescriptionACC04");
      regController.setFramePreferedSize(new Dimension(400,400));
      regController.setAllColumnVisible(false);
      regController.setVisibleColumn("registerCodeACC04",true);
      regController.setVisibleColumn("descriptionSYS10",true);
      regController.setPreferredWidthColumn("descriptionSYS10",290);
      regController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
        }

        public void beforeLookupAction(ValueObject parentVO) {
          regDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          regDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
        }

        public void forceValidate() {}

      });


      // vat code lookup...
      controlVatCode.setLookupController(vatController);
      controlVatCode.setControllerMethodName("getVatsList");
      vatController.setForm(detailPanel);
      vatController.setLookupDataLocator(vatDataLocator);
      vatDataLocator.setGridMethodName("loadVats");
      vatDataLocator.setValidationMethodName("validateVatCode");
      vatController.setFrameTitle("vats");
      vatController.setLookupValueObjectClassName("org.jallinone.registers.vat.java.VatVO");
      vatController.addLookup2ParentLink("vatCodeREG01", "vatCodeREG01");
      vatController.addLookup2ParentLink("descriptionSYS10","vatDescriptionREG01");
      vatController.addLookup2ParentLink("valueREG01","valueREG01");
      vatController.addLookup2ParentLink("deductibleREG01","deductibleREG01");
      vatController.setFramePreferedSize(new Dimension(400,400));
      vatController.setAllColumnVisible(false);
      vatController.setVisibleColumn("vatCodeREG01",true);
      vatController.setVisibleColumn("descriptionSYS10",true);
      vatController.setPreferredWidthColumn("descriptionSYS10",290);
      vatController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {}

        public void beforeLookupAction(ValueObject parentVO) {}

        public void forceValidate() {}

      });


      // payment code lookup...
      controlPayCode.setLookupController(paymentController);
      controlPayCode.setControllerMethodName("getPaymentsList");
      paymentController.setForm(headerPanel);
      paymentController.setLookupDataLocator(paymentDataLocator);
      paymentDataLocator.setGridMethodName("loadPayments");
      paymentDataLocator.setValidationMethodName("validatePaymentCode");
      paymentController.setFrameTitle("payments");
      paymentController.setLookupValueObjectClassName("org.jallinone.registers.payments.java.PaymentVO");
      paymentController.addLookup2ParentLink("paymentCodeREG10", "paymentCodeREG10");
      paymentController.addLookup2ParentLink("descriptionSYS10","paymentDescriptionREG10");
      paymentController.setFramePreferedSize(new Dimension(400,400));
      paymentController.setAllColumnVisible(false);
      paymentController.setVisibleColumn("paymentCodeREG10",true);
      paymentController.setVisibleColumn("descriptionSYS10",true);
      paymentController.setPreferredWidthColumn("descriptionSYS10",290);
      paymentController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {}

        public void beforeLookupAction(ValueObject parentVO) {
          paymentDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          paymentDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
        }

        public void forceValidate() {}

      });


      // account code lookup...
      controlAcode.setLookupController(accountController);
      controlAcode.setControllerMethodName("getAccounts");
      accountController.setForm(detailPanel);
      accountController.setLookupDataLocator(accountDataLocator);
      accountDataLocator.setGridMethodName("loadAccounts");
      accountDataLocator.setValidationMethodName("validateAccountCode");
      accountController.setFrameTitle("accounts");
      accountController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
      accountController.addLookup2ParentLink("accountCodeACC02", "accountCodeACC06");
      accountController.addLookup2ParentLink("descriptionSYS10","accountDescriptionACC06");
      accountController.setFramePreferedSize(new Dimension(400,400));
      accountController.setAllColumnVisible(false);
      accountController.setVisibleColumn("accountCodeACC02",true);
      accountController.setVisibleColumn("descriptionSYS10",true);
      accountController.setPreferredWidthColumn("descriptionSYS10",290);
      accountController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO accountVO = (AccountVO)accountController.getLookupVO();
          JournalRowVO vo = (JournalRowVO)detailPanel.getVOModel().getValueObject();
          vo.setAccountCodeAcc02ACC06(accountVO.getAccountCodeACC02());
          vo.setAccountCodeACC06(accountVO.getAccountCodeACC02());
//          controlAcode.setValue(accountVO.getAccountCodeACC02());
        }

        public void beforeLookupAction(ValueObject parentVO) {
          accountDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          accountDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
        }

        public void forceValidate() {}

      });


      // customer lookup...
      customerDataLocator.setGridMethodName("loadCustomers");
      customerDataLocator.setValidationMethodName("validateCustomerCode");
      controlCcode.setLookupController(customerController);
      controlCcode.setControllerMethodName("getCustomersList");
      customerController.setForm(headerPanel);
      customerController.setLookupDataLocator(customerDataLocator);
      customerController.setFrameTitle("customers");
      customerController.setLookupValueObjectClassName("org.jallinone.sales.customers.java.GridCustomerVO");
      customerController.addLookup2ParentLink("customerCodeSAL07","customerCodeSAL07");
      customerController.addLookup2ParentLink("name_1REG04", "name_1REG04");
      customerController.addLookup2ParentLink("progressiveREG04", "progressiveREG04");
      customerController.setAllColumnVisible(false);
      customerController.setVisibleColumn("companyCodeSys01REG04", true);
      customerController.setVisibleColumn("customerCodeSAL07", true);
      customerController.setVisibleColumn("name_1REG04", true);
      customerController.setVisibleColumn("name_2REG04", true);
      customerController.setVisibleColumn("cityREG04", true);
      customerController.setVisibleColumn("provinceREG04", true);
      customerController.setVisibleColumn("countryREG04", true);
      customerController.setVisibleColumn("taxCodeREG04", true);
      customerController.setHeaderColumnName("cityREG04", "city");
      customerController.setHeaderColumnName("provinceREG04", "prov");
      customerController.setHeaderColumnName("countryREG04", "country");
      customerController.setHeaderColumnName("taxCodeREG04", "taxCode");
      customerController.setPreferredWidthColumn("name_1REG04", 200);
      customerController.setPreferredWidthColumn("name_2REG04", 150);
      customerController.setFramePreferedSize(new Dimension(750,500));
      customerDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"ACC05_NEW_ITEM_VAT");
      customerDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"ACC05_NEW_ITEM_VAT");
      customerController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridCustomerVO custVO = (GridCustomerVO)customerController.getLookupVO();
          JournalHeaderWithVatVO vo = (JournalHeaderWithVatVO)headerPanel.getVOModel().getValueObject();
          vo.setCreditAccountCodeAcc02SAL07(custVO.getCreditAccountCodeAcc02SAL07());
        }

        public void beforeLookupAction(ValueObject parentVO) {
          customerDataLocator.getLookupFrameParams().put(ApplicationConsts.SUBJECT_TYPE,ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER);
          customerDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          customerDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          customerController.setHeaderColumnName("name_1REG04", "corporateName1");
          customerController.setHeaderColumnName("name_2REG04", "corporateName2");
        }

        public void forceValidate() {}

      });



      // supplier lookup...
      supplierDataLocator.setGridMethodName("loadSuppliers");
      supplierDataLocator.setValidationMethodName("validateSupplierCode");
      controlScode.setLookupController(supplierController);
      controlScode.setControllerMethodName("getSuppliersList");
      supplierController.setForm(headerPanel);
      supplierController.setLookupDataLocator(supplierDataLocator);
      supplierController.setFrameTitle("suppliers");
      supplierController.setLookupValueObjectClassName("org.jallinone.purchases.suppliers.java.GridSupplierVO");
      supplierController.addLookup2ParentLink("supplierCodePUR01","supplierCodePUR01");
      supplierController.addLookup2ParentLink("name_1REG04", "name_1REG04");
      supplierController.addLookup2ParentLink("progressiveREG04", "progressiveREG04");
      supplierController.setAllColumnVisible(false);
      supplierController.setVisibleColumn("companyCodeSys01REG04", true);
      supplierController.setVisibleColumn("supplierCodePUR01", true);
      supplierController.setVisibleColumn("name_1REG04", true);
      supplierController.setVisibleColumn("name_2REG04", true);
      supplierController.setVisibleColumn("cityREG04", true);
      supplierController.setVisibleColumn("provinceREG04", true);
      supplierController.setVisibleColumn("countryREG04", true);
      supplierController.setVisibleColumn("taxCodeREG04", true);
      supplierController.setHeaderColumnName("name_1REG04", "corporateName1");
      supplierController.setHeaderColumnName("cityREG04", "city");
      supplierController.setHeaderColumnName("provinceREG04", "prov");
      supplierController.setHeaderColumnName("countryREG04", "country");
      supplierController.setHeaderColumnName("taxCodeREG04", "taxCode");
      supplierController.setPreferredWidthColumn("name_1REG04", 200);
      supplierController.setPreferredWidthColumn("name_2REG04", 150);
      supplierController.setFramePreferedSize(new Dimension(750,500));
      supplierDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"ACC05_NEW_ITEM_VAT");
      supplierDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"ACC05_NEW_ITEM_VAT");
      supplierController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridSupplierVO supplierVO = (GridSupplierVO)supplierController.getLookupVO();
View Full Code Here

      customerController.setPreferredWidthColumn("name_1REG04", 200);
      customerController.setPreferredWidthColumn("name_2REG04", 150);
      customerController.setFramePreferedSize(new Dimension(750,500));
//      customerDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC01_ORDERS");
//      customerDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC01_ORDERS");
      customerController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridCustomerVO vo = (GridCustomerVO)customerController.getLookupVO();
          if (vo.getCustomerCodeSAL07()==null || vo.getCustomerCodeSAL07().equals("")) {
            controlCustName1.setText("");
            controlCustName2.setText("");
            grid.getOtherGridParams().remove(ApplicationConsts.COMPANY_CODE_SYS01);
            grid.getOtherGridParams().remove(ApplicationConsts.PROGRESSIVE_REG04);
          }
          else {
            controlCodCustomer.setValue(vo.getCustomerCodeSAL07());
            controlCustName1.setText(vo.getName_1REG04());
            controlCustName2.setText(vo.getName_2REG04());
            controlCodSupplier.setValue("");
            controlSupplierName1.setText("");
            controlSupplierName2.setText("");
            grid.getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
            grid.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveREG04());
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {}

        public void forceValidate() {}

      });


      // supplier lookup...
      supplierDataLocator.setGridMethodName("loadSuppliers");
      supplierDataLocator.setValidationMethodName("validateSupplierCode");

      controlCodSupplier.setLookupController(supplierController);
      controlCodSupplier.setControllerMethodName("getSuppliersList");
      supplierController.setLookupDataLocator(supplierDataLocator);
//      supplierController.setForm(filterPanel);
      supplierController.setFrameTitle("suppliers");
      supplierController.setLookupValueObjectClassName("org.jallinone.purchases.suppliers.java.GridSupplierVO");
      supplierController.setAllColumnVisible(false);
      supplierController.setVisibleColumn("companyCodeSys01REG04", true);
      supplierController.setVisibleColumn("supplierCodePUR01", true);
      supplierController.setVisibleColumn("name_1REG04", true);
      supplierController.setVisibleColumn("name_2REG04", true);
      supplierController.setVisibleColumn("cityREG04", true);
      supplierController.setVisibleColumn("provinceREG04", true);
      supplierController.setVisibleColumn("countryREG04", true);
      supplierController.setVisibleColumn("taxCodeREG04", true);
      supplierController.setHeaderColumnName("name_1REG04", "corporateName1");
      supplierController.setHeaderColumnName("cityREG04", "city");
      supplierController.setHeaderColumnName("provinceREG04", "prov");
      supplierController.setHeaderColumnName("countryREG04", "country");
      supplierController.setHeaderColumnName("taxCodeREG04", "taxCode");
      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) {
          GridSupplierVO vo = (GridSupplierVO)supplierController.getLookupVO();
          if (vo.getSupplierCodePUR01()==null || vo.getSupplierCodePUR01().equals("")) {
            controlSupplierName1.setText("");
            controlSupplierName2.setText("");
            grid.getOtherGridParams().remove(ApplicationConsts.COMPANY_CODE_SYS01);
            grid.getOtherGridParams().remove(ApplicationConsts.PROGRESSIVE_REG04);
          }
          else {
            controlCodSupplier.setValue(vo.getSupplierCodePUR01());
            controlSupplierName1.setText(vo.getName_1REG04());
            controlSupplierName2.setText(vo.getName_2REG04());
            controlCodCustomer.setValue("");
            controlCustName1.setText("");
            controlCustName2.setText("");
            grid.getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
            grid.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveREG04());
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {}

        public void forceValidate() {}

      });

      controlStartDate.addDateChangedListener(new DateChangedListener() {
        public void dateChanged(Date oldDate,Date newDate) {
          if (newDate!=null)
            grid.getOtherGridParams().put(ApplicationConsts.START_DATE,newDate);
          else
            grid.getOtherGridParams().remove(ApplicationConsts.START_DATE);
        }
      });

      controlEndDate.addDateChangedListener(new DateChangedListener() {
        public void dateChanged(Date oldDate,Date newDate) {
          if (newDate!=null)
            grid.getOtherGridParams().put(ApplicationConsts.END_DATE,newDate);
          else
            grid.getOtherGridParams().remove(ApplicationConsts.END_DATE);
        }
      });

      final Domain d = new Domain("INVOICE_DOC_TYPES");
      d.addDomainPair("","all invoices");
      d.addDomainPair(ApplicationConsts.SALE_DESK_DOC_TYPE,"desk selling");
      d.addDomainPair(ApplicationConsts.SALE_GENERIC_INVOICE,"sale invoice");
      d.addDomainPair(ApplicationConsts.PURCHASE_GENERIC_INVOICE,"purchase invoice");
      controlDocType.setDomain(d);
      controlDocType.getComboBox().addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          if (e.getStateChange() == e.SELECTED) {
            if (controlDocType.getValue()==null ||
                controlDocType.getValue().equals(""))
              grid.getOtherGridParams().remove(ApplicationConsts.DOC_TYPE);
            else
              grid.getOtherGridParams().put(ApplicationConsts.DOC_TYPE,controlDocType.getValue());
          }
        }
      });


      controlShowPayed.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          if (controlShowPayed.isSelected())
            // show all expirations: remove filter...
            grid.getOtherGridParams().remove(ApplicationConsts.PAYED);
          else
            // show NOT yet payed expirations: apply filter on "N" (not payed)
            grid.getOtherGridParams().put(ApplicationConsts.PAYED,"N");
        }
      });
//      controlShowPayed.setSelected(true);
      grid.getOtherGridParams().put(ApplicationConsts.PAYED,"N");

      colValue.setDynamicSettings(this);
      colPayedValue.setDynamicSettings(this);
      colAlreadyPayed.setDynamicSettings(this);



      Domain docTypeDomain = new Domain("DOC_TYPE");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_DOC_TYPE,"purchase invoice");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_FROM_DN_DOC_TYPE,"purchase invoice from delivery notes");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_FROM_PD_DOC_TYPE,"purchase invoice from purchase document");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_DEBIT_NOTE_DOC_TYPE,"debiting note");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_GENERIC_INVOICE,"purchase generic document");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_DOC_TYPE,"sale invoice");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_FROM_DN_DOC_TYPE,"sale invoice from delivery notes");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_FROM_SD_DOC_TYPE,"sale invoice from sale document");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_CREDIT_NOTE_DOC_TYPE,"credit note");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_GENERIC_INVOICE,"sale generic document");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_DESK_DOC_TYPE,"desk selling");
      colDocType.setDomain(docTypeDomain);


      // payment lookup...
      payTypeDataLocator.setGridMethodName("loadPaymentTypes");
      payTypeDataLocator.setValidationMethodName("validatePaymentTypeCode");

      colRealPayTipeCode.setLookupController(payTypeController);
      colRealPayTipeCode.setControllerMethodName("getPaymentTypesList");
      payTypeController.setLookupDataLocator(payTypeDataLocator);
      payTypeController.setFrameTitle("payment types");
      payTypeController.setLookupValueObjectClassName("org.jallinone.registers.payments.java.PaymentTypeVO");
      payTypeController.addLookup2ParentLink("paymentTypeCodeREG11", "realPaymentTypeCodeReg11DOC19");
      payTypeController.addLookup2ParentLink("descriptionSYS10","realPaymentDescriptionSYS10");
      payTypeController.setAllColumnVisible(false);
      payTypeController.setVisibleColumn("paymentTypeCodeREG11", true);
      payTypeController.setVisibleColumn("descriptionSYS10", true);
      new CustomizedColumns(new BigDecimal(222),payTypeController);
      payTypeController.addLookupListener(new LookupListener() {

        public void beforeLookupAction(ValueObject parentVO) {
        }

        public void codeChanged(ValueObject parentVO,
View Full Code Here

      empController.setVisibleColumn("name_1REG04", true);
      empController.setVisibleColumn("name_2REG04", true);
      empController.setPreferredWidthColumn("name_1REG04",150);
      empController.setPreferredWidthColumn("name_2REG04",150);
      empController.setFramePreferedSize(new Dimension(430,400));
      empController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridEmployeeVO empVO = (GridEmployeeVO)empController.getLookupVO();
View Full Code Here

      customerController.setPreferredWidthColumn("name_1REG04", 200);
      customerController.setPreferredWidthColumn("name_2REG04", 150);
      customerController.setFramePreferedSize(new Dimension(750,500));
      customerDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC01_ORDERS");
      customerDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC01_ORDERS");
      customerController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          DetailSaleDocVO vo = (DetailSaleDocVO)form.getVOModel().getValueObject();
          if (vo.getCustomerCodeSAL07()==null || vo.getCustomerCodeSAL07().equals("")) {
            // customer not defined: remove customer pricelist code and currency code...
            vo.setPricelistCodeSal01DOC01(null);
            vo.setPricelistDescriptionDOC01(null);
            vo.setCurrencyCodeReg03DOC01(null);
          }
          else {
            Response res = ClientUtils.getData("loadCustomer",new CustomerPK(
                vo.getCompanyCodeSys01DOC01(),
                vo.getProgressiveReg04DOC01(),
                ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER
            ));
            if (!res.isError()) {
              OrganizationCustomerVO custVO = (OrganizationCustomerVO)((VOResponse)res).getVo();
              if (custVO.getPricelistCodeSal01SAL07()!=null) {
                controlPricelistCode.setValue(custVO.getPricelistCodeSal01SAL07());
                pricelistController.forceValidate();
              }
            }
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {
          if (customerDataLocator.getLookupFrameParams().get(ApplicationConsts.SUBJECT_TYPE)==null)
            return;
          if (customerDataLocator.getLookupFrameParams().get(ApplicationConsts.SUBJECT_TYPE).equals(ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER)) {
            customerController.setHeaderColumnName("name_1REG04", "corporateName1");
            customerController.setHeaderColumnName("name_2REG04", "corporateName2");
          }
          else if (customerDataLocator.getLookupFrameParams().get(ApplicationConsts.SUBJECT_TYPE).equals(ApplicationConsts.SUBJECT_PEOPLE_CUSTOMER)) {
            customerController.setHeaderColumnName("name_1REG04", "firstname");
            customerController.setHeaderColumnName("name_2REG04", "lastname");
          }
        }

        public void forceValidate() {}

      });


      // pricelist lookup...
      pricelistDataLocator.setGridMethodName("loadPricelists");
      pricelistDataLocator.setValidationMethodName("validatePricelistCode");

      controlPricelistCode.setLookupController(pricelistController);
      controlPricelistCode.setControllerMethodName("getSalePricesList");
      pricelistController.setLookupDataLocator(pricelistDataLocator);
      pricelistController.setForm(form);
      pricelistController.setFrameTitle("pricelists");
      pricelistController.setLookupValueObjectClassName("org.jallinone.sales.pricelist.java.PricelistVO");
      pricelistController.addLookup2ParentLink("pricelistCodeSAL01","pricelistCodeSal01DOC01");
      pricelistController.addLookup2ParentLink("descriptionSYS10", "pricelistDescriptionDOC01");
      pricelistController.addLookup2ParentLink("currencyCodeReg03SAL01","currencyCodeReg03DOC01");
      pricelistController.setAllColumnVisible(false);
      pricelistController.setVisibleColumn("pricelistCodeSAL01", true);
      pricelistController.setVisibleColumn("descriptionSYS10", true);
      pricelistController.setVisibleColumn("currencyCodeReg03SAL01", 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...
          DetailSaleDocVO vo = (DetailSaleDocVO)form.getVOModel().getValueObject();
          pricelistDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC01());
          pricelistDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveReg04DOC01());
          pricelistDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC01());
          pricelistDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveReg04DOC01());
        }

        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", "paymentCodeReg10DOC01");
      payController.addLookup2ParentLink("descriptionSYS10","paymentDescriptionDOC01");
      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) {
          DetailSaleDocVO vo = (DetailSaleDocVO)form.getVOModel().getValueObject();
          payDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC01());
          payDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC01());
View Full Code Here

      itemController.setPreferredWidthColumn("itemDescriptionSYS10", 200);
      itemController.setPreferredWidthColumn("minSellingQtyITM01", 60);
      itemController.setPreferredWidthColumn("minSellingQtyUmCodeReg02ITM01", 50);
      itemController.setColumnDynamicSettings("valueSAL02",this);
      itemController.setFramePreferedSize(new Dimension(750,500));
      itemController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          // fill in the detail form, according to the selected item settings...
View Full Code Here

TOP

Related Classes of org.openswing.swing.lookup.client.LookupListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.