SVGHMI: JsonTable: Fixed options not being passed in JSON post when jumping to a page where additional variables are pre-defined by a HMI:VarInit.
Was JS Fetch Promise not executed late enough, and gathering JsonTable variables before the sequence of calls to dispatch() was finished.
// widget_customhtml.ysl2
template "widget[@type='CustomHtml']", mode="widget_class"{
||
class CustomHtmlWidget extends Widget{
frequency = 5;
widget_size = undefined;
dispatch(value) {
this.request_animate();
}
animate(){
}
init() {
this.widget_size = this.container_elt.getBBox();
this.element.innerHTML ='<foreignObject x="'+
this.widget_size.x+'" y="'+this.widget_size.y+
'" width="'+this.widget_size.width+'" height="'+this.widget_size.height+'"> '+
this.code_elt.textContent+
' </foreignObject>';
}
}
||
}
template "widget[@type='CustomHtml']", mode="widget_defs" {
param "hmi_element";
labels("container code");
|,
}