DialogField lookup and modified methods

protected Object dialog() { ; dialog = new DialogRunbase("Назначить кран", this); dialog.customFieldName_RU("dlgEquipmentGroup"); dlgEquipmentGroup = dialog.addFieldValue(extendedTypeStr(PortEquipmentGroupCode), ''); dlgEquipmentGroup.mcrReplaceOnLookup(false); dlgEquipmentGroup.control().registerOverrideMethod( methodStr(FormComboBoxControl, lookup), methodStr(ProtAssignFellNumber, dlgEquipmentGroup_lookup), this); dlgEquipmentGroup.control().registerOverrideMethod( methodStr(FormComboBoxControl, modified), methodStr(ProtAssignFellNumber, dlgEquipmentGroup_modified), this); dialog.customFieldName_RU("EquipmentCodeFlg"); EquipmentCodeFlg = dialog.addFieldValue(extendedTypeStr(PortEquipmentCodeFilter),""); EquipmentCodeFlg.mcrReplaceOnLookup(false); EquipmentCodeFlg.control().registerOverrideMethod( methodStr(FormComboBoxControl, modified), methodStr(ProtAssignFellNumber, EquipmentCodeFlg_modified), this); return dialog; } private void dlgEquipmentGroup_lookup(FormComboBoxControl _ctrl) { SysTableLookup sysTableLookup; Query query = new Query(); QueryBuildDataSource qbds; ; dialog.dialogOnClient_RU().updateServer(); sysTableLookup = SysTableLookup::newParameters(tableNum(PortEquipmentGroups), dialog.curFormControl_RU()); qbds = query.addDataSource(tableNum(PortEquipmentGroups)); sysTableLookup.addLookupfield(fieldNum(PortEquipmentGroups, EquipmentGroup), true); sysTableLookup.addLookupfield(fieldNum(PortEquipmentGroups, Description)); sysTableLookup.addLookupfield(fieldNum(PortEquipmentGroups, GroupType)); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup(); } protected boolean dlgEquipmentGroup_modified(FormComboBoxControl _control) { boolean ret; ; ret = _control.modified(); if (ret) { if (dlgEquipmentGroup.value()) EquipmentCodeFlg.enabled(false); else EquipmentCodeFlg.enabled(true); } return ret; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.