|
@@ -474,9 +474,17 @@ class _GuiCore(ElementLibrary):
|
|
|
return ["lib/taipy-gui-core.js"]
|
|
|
|
|
|
def on_init(self, gui: Gui) -> t.Optional[t.Tuple[str, t.Any]]:
|
|
|
- gui._add_adapter_for_type(_GuiCore.__SCENARIO_ADAPTER, _GuiCoreContext.scenario_adapter)
|
|
|
- gui._add_adapter_for_type(_GuiCore.__DATANODE_ADAPTER, _GuiCoreContext.data_node_adapter)
|
|
|
- return _GuiCore.__CTX_VAR_NAME, _GuiCoreContext(gui)
|
|
|
+ gui._get_default_locals_bind().update(
|
|
|
+ {
|
|
|
+ _GuiCoreContext._SCENARIO_SELECTOR_ERROR_VAR: "",
|
|
|
+ _GuiCoreContext._SCENARIO_SELECTOR_ID_VAR: "",
|
|
|
+ _GuiCoreContext._SCENARIO_VIZ_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)
|
|
|
+ return _GuiCore.__CTX_VAR_NAME, ctx
|
|
|
|
|
|
def on_user_init(self, state: State):
|
|
|
for var in [
|