Kaynağa Gözat

#247 declare globally the core gui variables (#249)

Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
Fred Lefévère-Laoide 1 yıl önce
ebeveyn
işleme
346f7e2aaf
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 8 0
      src/taipy/gui_core/GuiCoreLib.py

+ 8 - 0
src/taipy/gui_core/GuiCoreLib.py

@@ -560,6 +560,14 @@ class _GuiCore(ElementLibrary):
         return ["lib/taipy-gui-core.js"]
 
     def on_init(self, gui: Gui) -> t.Optional[t.Tuple[str, t.Any]]:
+        gui._get_default_locals_bind().update(
+            {
+                _GuiCoreContext._SCENARIO_SELECTOR_ERROR_VAR: "",
+                _GuiCoreContext._SCENARIO_SELECTOR_ID_VAR: "",
+                _GuiCoreContext._SCENARIO_VIZ_ERROR_VAR: "",
+                _GuiCoreContext._JOB_SELECTOR_ERROR_VAR: "",
+            }
+        )
         ctx = _GuiCoreContext(gui)
         gui._add_adapter_for_type(_GuiCore.__SCENARIO_ADAPTER, ctx.scenario_adapter)
         gui._add_adapter_for_type(_GuiCore.__DATANODE_ADAPTER, ctx.data_node_adapter)