svghmi/detachable_pages.ysl2
branchsvghmi
changeset 2901 3f5194bba67d
parent 2894 4cf9ad35e6d0
child 2903 881d0248b3ce
--- a/svghmi/detachable_pages.ysl2	Thu Mar 26 11:17:34 2020 +0100
+++ b/svghmi/detachable_pages.ysl2	Thu Mar 26 13:33:20 2020 +0100
@@ -102,9 +102,10 @@
 
     const "page_all_elements", "func:all_related_elements($page)";
 
-    const "all_page_widgets","$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id and not(@id=$in_forEach_widget_ids)]";
+    const "all_page_widgets","$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id]";
+    const "page_managed_widgets","$all_page_widgets[not(@id=$in_forEach_widget_ids)]";
     const "page_relative_widgets",
-        "$all_page_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]";
+        "$page_managed_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]";
 
     // Take closest ancestor in detachable_elements
     // since nested detachable elements are filtered out
@@ -126,7 +127,7 @@
     }
     |     ],
     |     absolute_widgets: [
-    foreach "$all_page_widgets[not(@id = $page_relative_widgets/@id)]" {
+    foreach "$page_managed_widgets[not(@id = $page_relative_widgets/@id)]" {
     |         hmi_widgets["«@id»"]`if "position()!=last()" > ,`
     }
     |     ],
@@ -135,9 +136,14 @@
     |         "«@id»": detachable_elements["«@id»"]`if "position()!=last()" > ,`
     }
     |     }
+    apply "$parsed_widgets/widget[@id = $all_page_widgets/@id]", mode="per_page_widget_template"{
+        with "page_desc", "$desc";
+    }
     |   }`if "position()!=last()" > ,`
 }
 
+template "*", mode="per_page_widget_template";
+
 function "debug_detachables" {
     | DETACHABLES:
     foreach "$detachable_elements"{