18.07.2008, 16:27 | #1 |
Модератор
|
метод Modified к stringControl
в методе RUN класса я генерируется форма с гридом. в родителе формы я положил источник , связанный с временной таблицей, которая запоняется в RUN класса.
Вопрос: Как к stringControl с именем "NameCtrl" добавить метод modified и по значению поля "NameCtrl" (выпадающий список, выбор пользователя) присвоить значение полю comboBoxControl с именем "TitleCtrl" ? вот код X++: void run() { Form form = new Form(formStr(InventJournalPrint_RU)); List reportList = List::create(inventJournalReportPackable.packReportList()); ListIterator it = new ListIterator(reportList); DictEnum dictEnum = new DictEnum(enumNum(InventJournalReportType_RU)); FormBuildDataSource formBuildDataSource; FormDataSource formDataSource; InventJournalReport_RU report; FormBuildTabControl tabControl; FormBuildTabPageControl pageControl; FormBuildGridControl gridControl; FormBuildGroupControl groupControl; FormBuildStringControl stringControl; FormBuildComboBoxControl comboBoxControl; FormBuildRealControl realControl; Args args; FormRun formRun; QueryBuildDataSource qbds; Str dsName; #define.DataGroupName("NamePosition"); if (reportList.empty()) return; control2Class = new Map(Types::Integer, Types::Class); groupControl = form.addControl(FormControlType::Group, ""); groupControl.widthMode(1); groupControl.heightMode(1); groupControl.frameType(1); tabControl = groupControl.addControl(FormControlType::Tab, ""); tabControl.widthMode(1); tabControl.heightMode(1); while (it.more()) { report = it.value(); if (! report) { it.next(); continue; } dsName = dictEnum.index2Symbol(report.reportType()); formBuildDataSource = form.addDataSource(dsName); formBuildDataSource.table(tableNum(OfficialsTrans_RU)); pageControl = tabControl.addControl(FormControlType::TabPage, ""); pageControl.caption(report.description()); pageControl.dataSource(dsName); pageControl.widthMode(1); pageControl.heightMode(1); gridControl = pageControl.addControl(FormControlType::Grid, ""); gridControl.widthMode(1); gridControl.heightMode(1); gridControl.dataSource(dsName); realControl = gridControl.addDataField(formBuildDataSource.id(), fieldNum(OfficialsTrans_RU, LineNum)); realControl.name("LineNum"); comboBoxControl = gridControl.addDataField(formBuildDataSource.id(), fieldNum(OfficialsTrans_RU, Position)); comboBoxControl.name("PositionCtrl"); control2Class.insert(comboBoxControl.id(), report); stringControl = gridControl.addDataField(formBuildDataSource.id(), fieldNum(OfficialsTrans_RU, Name)); stringControl.name("NameCtrl"); stringControl.lookupButton(2); control2Class.insert(stringControl.id(), report); comboBoxControl = gridControl.addDataField(formBuildDataSource.id(), fieldNum(OfficialsTrans_RU, Title)); comboBoxControl.name("TitleCtrl"); control2Class.insert(comboBoxControl.id(), report); it.next(); } args = new Args(); args.object(form); args.caller(this); formRun = classFactory.formRunClass(args); form = formRun.form(); formRun.init(); it.begin(); while (it.more()) { report = it.value(); if (! report) { it.next(); continue; } dsName = dictEnum.index2Symbol(report.reportType()); formDataSource = formRun.dataSource(dsName); qbds = formDataSource.query().dataSourceName(dsName); qbds.addRange(fieldNum(OfficialsTrans_RU, OffsessionId)).value(report.getOffSessionId()); qbds.addRange(fieldNum(OfficialsTrans_RU, reportType)).value(sysQuery::value(InventJournalReport_RU::inventJournalReportType2OffReportType(report.reportType()))); qbds.addSortField(fieldNum(OfficialsTrans_RU, LineNum)); offSessionId = report.getOffSessionId(); it.next(); } formRun.run(); formRun.wait(); } |
|