Added fix for #1044

This commit is contained in:
Vito Albano
2016-11-11 00:53:34 +00:00
parent 8195c00c74
commit 38b61a4f64
6 changed files with 163 additions and 45 deletions

View File

@@ -34,21 +34,44 @@ export class RadioButtonsWidget extends WidgetComponent implements OnInit {
ngOnInit() {
if (this.field && this.field.restUrl) {
this.formService
.getRestFieldValues(
this.field.form.taskId,
this.field.id
)
.subscribe(
(result: FormFieldOption[]) => {
this.field.options = result || [];
this.field.updateForm();
},
this.handleError
);
if (this.field.form.processDefinitionId) {
this.getOptionsByProcessDefinitionId();
} else {
this.getOptionsByTaskId();
}
}
}
getOptionsByTaskId() {
this.formService
.getRestFieldValues(
this.field.form.taskId,
this.field.id
)
.subscribe(
(result: FormFieldOption[]) => {
this.field.options = result || [];
this.field.updateForm();
},
this.handleError
);
}
getOptionsByProcessDefinitionId() {
this.formService
.getRestFieldValuesByProcessId(
this.field.form.processDefinitionId,
this.field.id
)
.subscribe(
(result: FormFieldOption[]) => {
this.field.options = result || [];
this.field.updateForm();
},
this.handleError
);
}
onOptionClick(optionSelected: any) {
this.field.value = optionSelected;
this.checkVisibility(this.field);