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

#48 MAJ de tous les composants ParamLinkComponent d'un formulaire quand un de...

 #48 MAJ de tous les composants ParamLinkComponent d'un formulaire quand un de ces composants est modifié (liste des paramètres liables)
parent 73743188
No related branches found
No related tags found
1 merge request!22Resolve "Lier des paramètres ou des résultats entre les calculettes"
......@@ -261,6 +261,13 @@ export class FieldSetComponent implements DoCheck {
this._paramComponents.forEach(fsc => fsc.updateParameterFromUI());
}
/**
* met à jour les paramètres liés
*/
public updateLinkedParameters() {
this._paramComponents.forEach(fsc => fsc.updateLinkedParameter());
}
/**
* clic sur le bouton ajouter
*/
......
......@@ -161,6 +161,13 @@ export class FieldsetContainerComponent implements DoCheck, AfterViewInit {
this._fieldsetComponents.forEach(fsc => fsc.updateParametersFromUI());
}
/**
* met à jour les paramètres liés
*/
public updateLinkedParameters() {
this._fieldsetComponents.forEach(fsc => fsc.updateLinkedParameters());
}
/**
* réception d'un événement de demande d'ajout d'un FieldSet
*/
......
......@@ -194,6 +194,7 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
*/
private onRadioClick(info: any) {
this._formulaire.onRadioClick(info);
this.updateLinkedParameters();
}
private onCloseForm() {
......@@ -219,6 +220,14 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
this._fieldsetContainerComponents.forEach(fscc => fscc.updateParametersFromUI());
}
/**
* met à jour les paramètres liés
*/
private updateLinkedParameters() {
this._fieldsetComponents.forEach(fsc => fsc.updateLinkedParameters());
this._fieldsetContainerComponents.forEach(fscc => fscc.updateLinkedParameters());
}
private doCompute() {
this.updateParametersFromUI();
this._formulaire.doCompute();
......
......@@ -6,6 +6,7 @@ import { NgParamInputComponent } from "../ngparam-input/ngparam-input.component"
import { ServiceFactory } from "../../services/service-factory";
import { ParamValueMode, CalculatorType, ParallelStructure } from "jalhyd";
import { FormulaireService } from "../../services/formulaire/formulaire.service";
import { ParamLinkComponent } from "../param-link/param-link.component";
@Component({
selector: "param-field-line",
......@@ -34,6 +35,9 @@ export class ParamFieldLineComponent implements OnChanges {
@ViewChild(NgParamInputComponent)
private _ngParamInputComponent: NgParamInputComponent;
@ViewChild(ParamLinkComponent)
private _paramLinkComponent: ParamLinkComponent;
@Output()
private onValid: EventEmitter<void>;
......@@ -360,4 +364,12 @@ export class ParamFieldLineComponent implements OnChanges {
public updateParameterFromUI() {
this._ngParamInputComponent.updateModelFromUI();
}
/**
* met à jour les paramètres liés
*/
public updateLinkedParameter() {
if (this._paramLinkComponent !== undefined)
this._paramLinkComponent.updateParamList();
}
}
......@@ -145,7 +145,7 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy {
}
}
private updateParamList() {
public updateParamList() {
// liste des paramètres liables
// this._linkableParams = this._formService.getLinkableParameters(this._param);
this._linkableParams = this._formService.getLinkableValues(this._param);
......
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