Skip to content
Snippets Groups Projects
Commit 835386ce authored by François Grand's avatar François Grand
Browse files

fix: SelectFieldDeviceStructureType defaut value

refs #592
parent 1df98b3b
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!199Resolve "Incohérence dans les fichiers de session"
...@@ -21,6 +21,14 @@ export class SelectFieldDeviceStructureType extends SelectField { ...@@ -21,6 +21,14 @@ export class SelectFieldDeviceStructureType extends SelectField {
this._configDefaultValue = json["default"]; this._configDefaultValue = json["default"];
} }
/**
* get discharge law linked to this select's nub
*/
private get structureType(): StructureType {
const child = this.nub.getChildren()[this.parent.indexAsKid()];
return child.getPropValue("structureType");
}
protected populate() { protected populate() {
// possible values depend on CalcType // possible values depend on CalcType
for (const st in (this.nub as ParallelStructure).getLoisAdmissibles()) { for (const st in (this.nub as ParallelStructure).getLoisAdmissibles()) {
...@@ -30,6 +38,6 @@ export class SelectFieldDeviceStructureType extends SelectField { ...@@ -30,6 +38,6 @@ export class SelectFieldDeviceStructureType extends SelectField {
} }
protected initSelectedValue() { protected initSelectedValue() {
this.findAndSetDefaultValue(); this.findAndSetDefaultValue(StructureType[this.structureType]);
} }
} }
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