Reset ui variables on refresh? #461
-
Hello, I have a form application where the user will set a few fields and then submits them. I noticed that while testing the GUI that the GUI does not reset if I do a browser refresh. Even if I close the window and open it in a different browser all the fields remain as they were last set by the user. Is there a way to reset the GUI elements to the defaults on refresh/reload? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Have a look at the documentation about the auto-index page. This is the simplest way to write a NiceGUI app, but it shares a common state for multiple users or browser sessions. If you use a |
Beta Was this translation helpful? Give feedback.
Have a look at the documentation about the auto-index page. This is the simplest way to write a NiceGUI app, but it shares a common state for multiple users or browser sessions. If you use a
ui.page
decorator instead, the pages are private and a browser refresh will reset the UI - or more precisely: it will re-run the page function.