Skip to content
Snippets Groups Projects
Commit 56759310 authored by François Grand's avatar François Grand
Browse files

fix: FieldSet.updateFields(): update inputs with nub values in case clearing is not forced

refs #601
parent 5029dfcd
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!203Resolve "Solveur multimodule: le module existe toujours après suppression"
......@@ -4,7 +4,8 @@ import {
IProperties,
Observer,
Nub,
enumValueFromString
enumValueFromString,
ParamValueMode
} from "jalhyd";
import { FormulaireElement } from "./formulaire-element";
......@@ -215,8 +216,32 @@ export class FieldSet extends FormulaireElement implements IProperties {
public updateFields(forceClear: boolean) {
if (forceClear) {
this.clearFields();
this.parseFields();
}
this.parseFields();
else {
const nub = this.parentForm.currentNub;
for (const e of this.parentForm.allFormElements) {
if (e instanceof NgParameter) {
const p: ParamDefinition = nub.getParameter(e.symbol);
switch (e.paramDefinition.valueMode) {
case ParamValueMode.SINGLE:
e.setValue(this, p.singleValue);
break;
case ParamValueMode.MINMAX:
e.setMinValue(this, p.min);
e.setMaxValue(this, p.max);
e.setStepValue(this, p.step);
break;
case ParamValueMode.LISTE:
e.setValueList(this, p.valueList);
break;
}
}
}
}
this.updateLocalisation();
// for all select fields known by the form, set selected value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment