Thank you for your answer. I was tasked to do via OXML technology so can't use SysOperation classes.
I have added additional method to my class:
private void reportMethodModified(FormCheckBoxControl _checkBoxControl)
{
if(dlgReportSelectMethod.value())
{
dlgToDate.enabled(false);
dlgFromDate.enabled(false);
dlgItemId.enabled(true);
dlgFromDate.value('');
dlgToDate.value('');
}
else
{
dlgToDate.enabled(true);
dlgFromDate.enabled(true);
dlgitemId.enabled(false);
dlgitemId.value('');
dlgFromDate.value(mkDate(1,1,year(systemDateGet())));
dlgToDate.value(mkDate(31,12,year(systemDateGet())));
}
}
Then my dialog() method looks like that:
protected Object dialog()
{
DialogRunbase dialog = new DialogRunbase('Анализ количества технически обоснованных форм', this);
DialogGroup dialogGroup;
dialogGroup = dialog.addGroup('Parameters');
dialogGroup.caption('Параметры');
dlgReportSelectMethod = dialog.addfieldvalue(enumstr(TechnReasonableReportSelectMethod_ICL1),reportSelectMethod);
dlgFromDate = dialog.addFieldValue(extendedTypeStr(FromDate),fromDate);
dlgToDate = dialog.addFieldValue(extendedTypeStr(ToDate),toDate);
dlgItemId = dialog.addFieldValue(extendedTypeStr(ItemIdProduction),itemIdProduction);
dlgInventSiteId = dialog.addFieldValue(extendedTypeStr(InventSiteId),inventSiteId);
dlgItemId.registerOverrideMethod(methodStr(FormStringControl, lookup)
,methodStr(ExportAnalisTechnJustifiedNorms_ICL,customLookup)
,this);
dlgReportSelectMethod.registerOverrideMethod(methodStr(FormCheckBoxControl, modified)
,methodStr(ExportAnalisTechnJustifiedNorms_ICL, reportMethodModified)
,this);
return dialog;
}
I have overridden modified() method acting on your advice. It works but not as I expected:
1) Firstly, when I open the dialog there is a value already in dlgReportSelectMethod. For you to understand the values in Russian (sorry)
По производственной программе = enum value 0
По изделию = enum value 1
So when I open the dialog there is a default value dlgReportSelectMethod = По производственной программе = enum value 0 but dialog doesn't update other field (dlgFromDate, dlgToDate, dlgItemId) values until I manually modify dlgReportSelectMethod and that's expected behavior. Is there any workaround for this? Maybe at least make a value for dlgReportSelectMethod to be empty somehow until user chooses one and modified() method will trigger.
2) When I choose any value in field dlgReportSelectMethod overridden method modified() works correct but visible value in dlgReportSelectMethod field stays the same even when I change it. So even if I choose По производственной программе = enum value 0 or По изделию = enum value 1 the visible value stays the same "По производственной программе". I have chosen two different values in dlgReportSelectMethod field. Overridden method modified() worked fine but the visible value in the form stays the same По производственной программе. Is there any way to refresh it?
Then I choose По изделию = enum value 1 but dlgReportSelectMethod field visible value stays the same (however overridden method modified() method worked fine)
How to fix this?
When I do without overridden method modified() (commented it) it changes correctly:
Thank you.