SVGHMI: JsonTable should refresh when re-subscibing, because data might have changed while not on the page we are switching to. svghmi
authorEdouard Tisserant
Tue, 16 Mar 2021 14:18:39 +0100
branchsvghmi
changeset 3189 0733114a2090
parent 3188 c173452bf894
child 3190 80dd371e15bb
SVGHMI: JsonTable should refresh when re-subscibing, because data might have changed while not on the page we are switching to.
svghmi/gen_index_xhtml.xslt
svghmi/widget_jsontable.ysl2
--- a/svghmi/gen_index_xhtml.xslt	Mon Mar 15 11:25:24 2021 +0100
+++ b/svghmi/gen_index_xhtml.xslt	Tue Mar 16 14:18:39 2021 +0100
@@ -4661,6 +4661,16 @@
 </xsl:text>
     <xsl:text>
 </xsl:text>
+    <xsl:text>    sub(...args){
+</xsl:text>
+    <xsl:text>        this.cache[0] = undefined;
+</xsl:text>
+    <xsl:text>        super.sub(...args);
+</xsl:text>
+    <xsl:text>    }
+</xsl:text>
+    <xsl:text>
+</xsl:text>
     <xsl:text>    dispatch(value, oldval, index) {
 </xsl:text>
     <xsl:text>
--- a/svghmi/widget_jsontable.ysl2	Mon Mar 15 11:25:24 2021 +0100
+++ b/svghmi/widget_jsontable.ysl2	Tue Mar 16 14:18:39 2021 +0100
@@ -52,6 +52,11 @@
             super.unsub();
         }
 
+        sub(...args){
+            this.cache[0] = undefined;
+            super.sub(...args);
+        }
+
         dispatch(value, oldval, index) {
 
             if(this.cache[index] != value)