Skip to content
Snippets Groups Projects
Commit 263fc102 authored by mathias.chouet's avatar mathias.chouet
Browse files

PAB: chargement du <select> avec la valeur de la propriété modeleCloisons

parent 0f755e6e
No related branches found
No related tags found
No related merge requests found
......@@ -223,9 +223,8 @@ export class FormulairePab extends FormulaireBase {
(sender.nub as PabCloisons).setModel(newModeleUID);
// treat the fieldset as new to re-subscribe to Nub properties change events
this.afterParseFieldset(sender);
// this.reset();
this.reset();
// console.log(this.currentNub);
this.dumpPabStructure(this.currentNub as Pab);
break;
}
......
......@@ -379,7 +379,11 @@ export class FieldSet extends FormulaireElement implements Observer {
this.setPropValue("varCalc", data.value.value);
break;
case "select_modele_cloisons": // passe à bassins, modèle de cloisons
this.setPropValue("modeleCloisons", data.value.id);
let valToSet;
if (data.value) {
valToSet = data.value.id;
}
this.setPropValue("modeleCloisons", valToSet);
break;
}
break;
......
import { SelectField } from "./select-field";
import { Session } from "jalhyd";
import { SelectEntry } from "./select-entry";
import { FormulaireNode } from "./formulaire-node";
import { FieldSet } from "./fieldset";
/**
* A select field that populates itself with references to
......@@ -8,6 +10,16 @@ import { SelectEntry } from "./select-entry";
*/
export class SelectFieldCloisons extends SelectField {
constructor(parent: FormulaireNode) {
super(parent);
if (this.parent instanceof FieldSet) {
const mc = this.parent.nub.properties.getPropValue("modeleCloisons");
if (mc) {
this._selectedEntry = new SelectEntry(mc, {});
} // else if current model is undefined, do not select it so that default Cloisons will be chosen (if available)
}
}
/**
* Populates entries with available Cloisons
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment