diff --git a/src/app/formulaire/elements/fieldset.ts b/src/app/formulaire/elements/fieldset.ts index 1190098beb85c368c1b14954979f95cadbbbbd21..89a696bf0045946a6c899be01719cc46c5cd15e1 100644 --- a/src/app/formulaire/elements/fieldset.ts +++ b/src/app/formulaire/elements/fieldset.ts @@ -111,6 +111,7 @@ export class FieldSet extends FormulaireElement implements Observer { private parse_select(json: {}): SelectField { const res: SelectField = SelectFieldFactory.newSelectField(json, this); res.parseConfig(json); + res.afterParseConfig(); res.addObserver(this); return res; } diff --git a/src/app/formulaire/elements/select/select-field-factory.ts b/src/app/formulaire/elements/select/select-field-factory.ts index 38e8e7b49dda4cebca3d4a093252b911d0c34b4f..c7ae60316a39bd06ba8fd4b964c4fe269c3356b1 100644 --- a/src/app/formulaire/elements/select/select-field-factory.ts +++ b/src/app/formulaire/elements/select/select-field-factory.ts @@ -57,10 +57,10 @@ export class SelectFieldFactory { case "select_section": case "select_sppoperation": case "select_unit": - return new SelectFieldNubProperty(parent, json); + return new SelectFieldNubProperty(parent); default: throw new Error("unknown select id ${id}"); } } -} \ No newline at end of file +} diff --git a/src/app/formulaire/elements/select/select-field-nub-prop.ts b/src/app/formulaire/elements/select/select-field-nub-prop.ts index eca0463b303ed9766f0dad6d2121d807735b957f..df62610a8a9c288d571618c59d954eec395d7546 100644 --- a/src/app/formulaire/elements/select/select-field-nub-prop.ts +++ b/src/app/formulaire/elements/select/select-field-nub-prop.ts @@ -15,8 +15,12 @@ import { SelectField } from "./select-field"; // nub property values taken from an enum // "standard" select that normally does not require customisation export class SelectFieldNubProperty extends SelectField { - constructor(parent: FormulaireNode, json: {}) { + constructor(parent: FormulaireNode) { super(parent); + } + + public parseConfig(json: {}, data?: {}) { + super.parseConfig(json, data); this._associatedProperty = json["property"]; this._configDefaultValue = json["default"]; } @@ -35,4 +39,4 @@ export class SelectFieldNubProperty extends SelectField { protected initSelectedValue() { this.findAndSetDefaultValue(); } -} \ No newline at end of file +} diff --git a/src/app/formulaire/elements/select/select-field.ts b/src/app/formulaire/elements/select/select-field.ts index e904498824d8ac9082c6ecdae0bb8e523b5f3612..435d042f39ef777de393a1e0ec0024a3f7f4a18c 100644 --- a/src/app/formulaire/elements/select/select-field.ts +++ b/src/app/formulaire/elements/select/select-field.ts @@ -143,7 +143,7 @@ export abstract class SelectField extends Field { this._confId = field["id"]; this._entriesBaseId = this._confId + "_"; this._helpLink = field["help"]; - this.afterParseConfig(); + //this.afterParseConfig(); // done in FieldSet.parse_select() } /** @@ -151,7 +151,7 @@ export abstract class SelectField extends Field { * (needs config for this._entriesBaseId to be set). * Triggered at the end of parseConfig() */ - protected afterParseConfig() { + public afterParseConfig() { this.populate(); this.initSelectedValue(); }