Skip to content
Snippets Groups Projects
Commit b43145b2 authored by AUBRY JEAN-PASCAL's avatar AUBRY JEAN-PASCAL
Browse files

fix: implement update function when another macro rugo is selected

parent 027bec85
No related branches found
No related tags found
2 merge requests!252release: version 4.18.0,!213Resolve "Ajout du module courbe de remous d'une passe à macro-rugosité"
Pipeline #151602 passed
......@@ -16,6 +16,7 @@ export class FormulaireMacrorugoRemous extends FormulaireFixedVar {
}
if (pam !== undefined) {
props.setPropValue("nubMacroRugo", pam.uid);
}
return super.initNub(props);
}
......@@ -40,6 +41,7 @@ export class FormulaireMacrorugoRemous extends FormulaireFixedVar {
}
protected reaffectResultComponents() {
console.log("reaffect");
const mrr = this.currentNub as MacrorugoRemous;
mrr.syncSectionMacroRugo();
......@@ -81,30 +83,28 @@ export class FormulaireMacrorugoRemous extends FormulaireFixedVar {
// interface Observer
// public update(sender: IObservable, data: any) {
// // copied from FormDefinition, to avoid calling super.update() that would trigger an unwanted this.refreshFieldsets();
// if (sender instanceof Nub) {
// switch (data.action) {
// case "resultUpdated":
// // forward Nub results update notification to FormCompute objects
// this.reaffectResultComponents();
// break;
// }
// }
// // copied from FormFixedVar, to avoid calling super.update()
// if (data.action === "propertyChange") {
// this.reset();
// }
// if (sender instanceof SelectField) {
// this.reset(); // reset results
// console.log("update", data.action)
// if (sender.id === "select_target_pam" && data.action === "select") {
// // update Verificateur property: Pass to check
// this._currentNub.setPropValue("nubToVerify", data.value ? data.value.value : undefined);
// }
// }
// }
public update(sender: IObservable, data: any, props?: Props) {
// copied from FormDefinition, to avoid calling super.update() that would trigger an unwanted this.refreshFieldsets();
if (sender instanceof Nub) {
switch (data.action) {
case "resultUpdated":
// forward Nub results update notification to FormCompute objects
this.reaffectResultComponents();
break;
}
}
// copied from FormFixedVar, to avoid calling super.update()
if (data.action === "propertyChange") {
this.reset();
}
if (sender instanceof SelectField) {
this.reset(); // reset results
if (sender.id === "select_target_pam" && data.action === "select") {
this._currentNub.setPropValue("nubMacroRugo",data.value.value);
}
}
}
public resetFormResults() {
this._remousResults.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