svghmi/widget_jsontable.ysl2
changeset 4056 4b2de1a0fbf9
parent 3386 608f48ad3dfc
--- a/svghmi/widget_jsontable.ysl2	Thu Nov 28 14:46:50 2024 +0100
+++ b/svghmi/widget_jsontable.ysl2	Mon Dec 02 11:33:19 2024 +0100
@@ -6,7 +6,7 @@
     Send given variables as POST to http URL argument, spread returned JSON in
     SVG sub-elements of "data" labeled element.
     
-    Documentation to be written. see svghmi exemple.
+    Documentation to be written. see svghmi example.
     ||
 
     shortdesc > Http POST variables, spread JSON back
@@ -113,7 +113,7 @@
     param "label";
 
     // compute javascript expressions to access JSON data
-    // desscribed in given svg element's "label"
+    // described in given svg element's "label"
     // knowing that parent element already has given "expressions".
 
     choose {
@@ -128,7 +128,7 @@
                     when "contains($suffix,'=')" {
                         const "name", "substring-before($suffix,'=')";
                         if "$expr/@name[. != $name]"
-                            error > JsonTable : missplaced '=' or inconsistent names in Json data expressions.
+                            error > JsonTable : misplaced '=' or inconsistent names in Json data expressions.
                         attrib "name" value "$name";
                         attrib "content" > «$expr/@content»«substring-after($suffix,'=')»
                     }
@@ -176,7 +176,7 @@
         when "count($from_textstylelist) > 0" {
             const "content_expr", "$expressions/expression[2]/@content";
             if "string-length($content_expr) = 0 or $expressions/expression[2]/@name != 'textContent'"
-                error > Clones (svg:use) in JsonTable Widget pointing to a HMI:TextStyleList widget or item must have a "textContent=.someVal" assignement following value expression in label.
+                error > Clones (svg:use) in JsonTable Widget pointing to a HMI:TextStyleList widget or item must have a "textContent=.someVal" assignment following value expression in label.
             |         {
             |           let elt = id("«@id»");
             |           elt.textContent = String(«$content_expr»);
@@ -189,8 +189,13 @@
     }
 }
 
-
-// only labels comming from Json widget are counted in
+template "svg:image", mode="json_table_elt_render" {
+    param "expressions";
+    const "value_expr", "$expressions/expression[1]/@content";
+    |         id("«@id»").setAttribute('href', String(«$value_expr»));
+}
+
+// only labels coming from Json widget are counted in
 def "func:filter_non_widget_label" {
     param "elt";
     param "widget_elts";