多选下拉
[FormControlEventHandler(formControlStr(ProjTable, ProjTable_VyaWorkAddressCountry), FormControlEventType::Lookup)]
public static void ProjTable_VyaWorkAddressCountry_OnLookup(FormControl sender, FormControlEventArgs e)
{
SysLookupMultiSelectGrid currencySelectionLookUp;
container selectFields = conNull();
FormRun element = sender.formRun();
selectFields = [tableNum(LogisticsAddressCountryRegionTranslation), fieldNum(LogisticsAddressCountryRegionTranslation,CountryRegionId )];
Query query = new Query();
QueryBuildDataSource qbds = query.addDataSource(tablenum(LogisticsAddressCountryRegionTranslation));
qbds.addSelectionField(fieldNum(LogisticsAddressCountryRegionTranslation,CountryRegionId ));
qbds.addSelectionField(fieldNum(LogisticsAddressCountryRegionTranslation, ShortName ));
currencySelectionLookUp = new SysLookupMultiSelectGrid();
currencySelectionLookUp.parmCallingControl(sender);
currencySelectionLookUp.parmQuery(query);
currencySelectionLookUp.parmSelectField(selectFields);
currencySelectionLookUp.parmCallingControlId(sender);
currencySelectionLookUp.parmCallingControlStr(sender);
currencySelectionLookUp.run();
LogisticsAddressCountryRegionTranslation logisCountry;
container result = currencySelectionLookUp.getSelected();
str country;
for (int i = 1 ; i <= conLen(result); i++)
{
logisCountry.clear();
logisCountry = LogisticsAddressCountryRegionTranslation::findByRecId(conPeek(result, i));
country += (logisCountry.CountryRegionId + ";");
}
ProjTable projTable = sender.formRun().dataSource("ProjTable").cursor();
projTable.VyaWorkAddressCountry = country;
FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
//cancel super() to prevent error.
ce.CancelSuperCall();
}
浙公网安备 33010602011771号