🔍 What went wrong?
- Submitting scenario via tgb.scenario will update the job selector
- Submitting scenario via callback will not update the job selector
Example code:
import time
import taipy as tp
import taipy.gui.builder as tgb
from taipy import Config
from taipy.gui import Gui
import datetime as dt
def square(x: int) -> int:
time.sleep(5)
return x**2
x_xfg = Config.configure_data_node(id="x", default_data=5)
y_xfg = Config.configure_data_node(id="y")
square_task_cfg = Config.configure_task(id="square", function=square, input=x_xfg, output=y_xfg)
scenario_cfg = Config.configure_scenario(id="scenario", task_configs=[square_task_cfg])
selected_scenario = None
with tgb.Page() as root_page:
with tgb.layout():
with tgb.part():
tgb.button(
"Create scenario",
on_action=lambda state: tp.create_scenario(
scenario_cfg, name=f"Scenario - {dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}"
),
)
tgb.scenario_selector("{selected_scenario}")
with tgb.part():
tgb.scenario("{selected_scenario}")
tgb.button("Submit selected scenario", on_action=lambda state: state.selected_scenario.submit())
tgb.job_selector()
pages = {"/": root_page}
if __name__ == "__main__":
Config.configure_job_executions(mode="standalone", max_nb_of_workers=1)
orchestrator = tp.Orchestrator()
orchestrator.run()
gui = Gui(pages=pages)
gui.run(dark_mode=False, run_browser=False)
🔄 Steps to Reproduce
- Click "Create scenario"
- Click Submit in the tgb.scenario
- Observe that the job selector updates with the running job
- Click "Create scenario"
- Click "Submit selected scenario" regular button
- Observe that the job selector does not update
- Refresh the page: no update
- Reopen browser: successful update
📦 Taipy Version
develop
📋 Additional Context (Optional)
📜 Code of Conduct
✅ Acceptance Criteria
🔍 What went wrong?
Example code:
🔄 Steps to Reproduce
📦 Taipy Version
develop
📋 Additional Context (Optional)
📜 Code of Conduct
✅ Acceptance Criteria