From ddd5419c6f37d9252bfa72194e59bbc5237ed0d6 Mon Sep 17 00:00:00 2001 From: Mathias Chouet <mathias.chouet@irstea.fr> Date: Wed, 22 Apr 2020 10:45:38 +0200 Subject: [PATCH] Fix again --- src/app/formulaire/definition/form-verificateur.ts | 2 +- src/app/formulaire/elements/select-field-custom.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/formulaire/definition/form-verificateur.ts b/src/app/formulaire/definition/form-verificateur.ts index 0c7db5328..92d538c98 100644 --- a/src/app/formulaire/definition/form-verificateur.ts +++ b/src/app/formulaire/definition/form-verificateur.ts @@ -29,7 +29,7 @@ export class FormulaireVerificateur extends FormulaireFixedVar { if (sender instanceof SelectFieldCustom) { if (sender.id === "select_target_pass" && data.action === "select") { // update Verificateur property: Pass to check - (this._currentNub as Verificateur).nubToVerify = data.value ? data.value.value : undefined; + this._currentNub.properties.setPropValue("nubToVerify", data.value ? data.value.value : undefined); // refresh jet type selector const ntv = (this._currentNub as Verificateur).nubToVerify; (this.getFormulaireNodeById("select_pab_jet_type") as SelectField).disabled = ! (ntv !== undefined && ntv.calcType === CalculatorType.Pab); diff --git a/src/app/formulaire/elements/select-field-custom.ts b/src/app/formulaire/elements/select-field-custom.ts index 7b5584a50..393d5a0bb 100644 --- a/src/app/formulaire/elements/select-field-custom.ts +++ b/src/app/formulaire/elements/select-field-custom.ts @@ -44,7 +44,10 @@ export class SelectFieldCustom extends SelectField { case "verificateur_species": // Vérificateur, liste d'espèces (choix multiple) const sl = (nub as Verificateur).speciesList; if (sl !== undefined) { - this.setValueFromId(sl.map((s) => this._entriesBaseId + s )); + this.setValueFromId(sl.map((s) => { + const spgId = s.substring(s.lastIndexOf("_") + 1); + return this._entriesBaseId + spgId; + })); } break; } -- GitLab