Skip to content
Snippets Groups Projects
Commit a8335b66 authored by francois.grand's avatar francois.grand
Browse files

#77 sections paramétrées : réinitialisation du formulaire quand on change la variable à calculer

parent 844ec86e
No related branches found
No related tags found
1 merge request!15Resolve "faire les modifications nécessaires prendre en compte le ticket cassiopee/jalhyd#46 (Gestion de la session dans la lib)"
......@@ -279,6 +279,7 @@
},
{
"type": "options",
"sectionSourceId": "fs_section"
"sectionSourceId": "fs_section",
"targetSelectId": "select_target"
}
]
\ No newline at end of file
......@@ -16,6 +16,11 @@ export class FormDefSection implements Observer {
*/
private _sectionSourceId: string;
/**
* id du select configurant la variable à calculer
*/
private _targetSelectId: string;
/**
* Type de noeud de calcul actuel de la section (si la calculette est basée sur une section et qu'un menu permet
* de sélectionner le type de section)
......@@ -78,6 +83,9 @@ export class FormDefSection implements Observer {
public parseOptions(json: {}) {
// id de l'élément configurant le type de section
this._sectionSourceId = this._formBase.getOption(json, "sectionSourceId");
// id du select configurant la variable à calculer
this._targetSelectId = this._formBase.getOption(json, "targetSelectId");
}
public completeParse() {
......@@ -87,6 +95,10 @@ export class FormDefSection implements Observer {
se.addObserver(this);
this.updateSectionNodeType()
}
if (this._targetSelectId) {
const sel = this._formBase.getFormulaireNodeById(this._targetSelectId);
sel.addObserver(this);
}
}
// interface Observer
......@@ -95,5 +107,9 @@ export class FormDefSection implements Observer {
if (data.action == "propertyChange") {
this.updateSectionNodeType();
}
// RAZ formulaire quand on change la variable à calculer
if (sender instanceof SelectField)
this._formBase.reset();
}
}
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