单选

  • 普通Lookup

     public Lookup(){
         Query                           query = new Query();
         QueryBuildDataSource            queryBuildDataSource;
         QueryBuildRange                 queryBuildRange;
         HRMAbsenceCode                  HRMAbsenceCode ;
    
         SysTableLookup                  sysTableLookup =
         SysTableLookup::newParameters(tableNum(HRMAbsenceCode), sender);
         sysTableLookup.addLookupField(fieldNum(HRMAbsenceCode,DESCRIPTION),true);
         sysTableLookup.addSelectionfield(fieldNum(HRMAbsenceCode,RecId)  );
    
         queryBuildDataSource = query.addDataSource(tableNum(HRMAbsenceCode));
         queryBuildDataSource.addRange(fieldNum(HRMAbsenceCode, LinkWithBenefitAccural)).value((any2Str(NoYes::yes)));
         sysTableLookup.parmQuery(query);
         sysTableLookup.performFormLookup();
      }
    

多选

  • normal

       public Lookup(){
          Query query = new Query();
          QueryBuildDataSource    qbds     = query.addDataSource(tablenum(tb));
          qbds.fields().addField(fieldNum(tb, field));
          container selectedFields = [tableNum(tb), fieldNum(tb, field)];
          SysLookupMultiSelectCtrl::constructWithQuery(this, VoucherList, query, true,    selectedFields);
      }
    

tips:

  • EventHandler 取消原窗体调用:

     FormControlCancelableSuperEventArgs cancelSuperEventArgs = e as FormControlCancelableSuperEventArgs;
     cancelSuperEventArgs.CancelSuperCall();
  • 临时表

     sysTableLookup.parmQuery(query);
     sysTableLookup.parmTmpBuffer(TmpTableFieldLookup);
     sysTableLookup.performFormLookup();
    

标签: none

添加新评论