I implemented a toy example based on stock_app.py:
What is supposed to happen:
-
Click the “Select plot criteria” button to reveal a “Submit” button and a Select widget.
-
Select a number from the Select widget…
-
Click the “Submit” button to show the selected number in a Paragraph widget.
-
(Optional) Click the “Cancel” button (which is just the re-labelled “Select plot criteria” button) to hide the “Submit” button and Select widget.
What actually happens:
-
Click the “Select plot criteria” and nothing happens.
-
Click the “Select plot criteria” a to reveal a “Submit” button and a Select widget.
-
Select a number from the Select widget.
-
Click the “Submit” button, at which point the entire app seems to reboot to its original state.
-
(Optional) Click the “Cancel” button to hide the “Submit” button and Select widget but nothing happens.
-
(Optional) Click the “Cancel” button again to actually hide the “Submit” button and Select widget.
Questions:
-
Why do I have to click my buttons twice in order to get them to work?
-
Why does the
submit_menucallback on my “Submit” button, which just sets the Paragraph text and toggles the menu, restart the entire app?
This clearly doesn’t happen on the stock_app.py example, any while that example doesn’t involve the hiding of input widgets, it seems safe to assume this is a problem with my code. Can anyone help?
