Skip to content
Snippets Groups Projects
Commit e4e94698 authored by Mathias Chouet's avatar Mathias Chouet
Browse files

Fix bug in fieldsets refresh after compute

parent e0fe53bf
No related branches found
No related tags found
No related merge requests found
......@@ -89,8 +89,8 @@ export class FormulaireFixedVar extends FormulaireDefinition {
protected compute() {
this.runNubCalc(this.currentNub);
this.refreshFieldsets(); // important: before reaffectResultComponents() or it will break results components localization
this.reaffectResultComponents();
this.refreshFieldsets();
}
protected reaffectResultComponents() {
......@@ -118,6 +118,9 @@ export class FormulaireFixedVar extends FormulaireDefinition {
}
}
/**
* Forces all fieldsets to update all their fields
*/
protected refreshFieldsets() {
for (const fs of this.allFieldsets) {
fs.updateFields();
......@@ -132,9 +135,7 @@ export class FormulaireFixedVar extends FormulaireDefinition {
if (data.action === "propertyChange") {
this.reset();
// reflect changes in GUI (who knows ?), for ex. show / hide dependent fields
for (const fs of this.allFieldsets) {
fs.updateFields();
}
this.refreshFieldsets();
}
}
}
......@@ -87,10 +87,8 @@ export class FormulaireMacrorugoCompound extends FormulaireRepeatableFieldset {
* Reflect inclinedApron property state in GUI
*/
public updateApronState(inclined: MRCInclination) {
for (const fs of this.allFieldsets) {
// show / hide dependent fields (read from model)
fs.updateFields();
}
// show / hide dependent fields (read from model)
this.refreshFieldsets();
// show / hide children list (GUI only)
for (const elt of this.allFormElements) {
if (elt instanceof FieldsetContainer) {
......
......@@ -18,6 +18,8 @@ export class FormulaireSection extends FormulaireFixedVar {
// show / hide dependent fields
fs.updateFields();
}
// show / hide dependent fields
this.refreshFieldsets();
// empty fields ? only those belonging to the specific section type
if (ServiceFactory.instance.applicationSetupService.enableEmptyFieldsOnFormInit) {
// "LargeurBerge" is hackily used as LargeurFond in Rectangular and Trapez sections, omit it here
......
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