TangleSpace / hydralit

A library to create multi-page Streamlit applications with ease.
Apache License 2.0
202 stars 19 forks source link

Keyed widget values are lost when switching the pages #48

Open Yashar78 opened 1 year ago

Yashar78 commented 1 year ago

I have a two page application where in one of them I have a few widgets like text box which is connected to a session state variable via the key. It works fine until I am in this page but if I open the other page and comeback again then the widget values and their session state values are lost. I tried this solution https://gist.github.com/okld/8ca97ba892a7c20298fd099b196a8b4d but it fails and shows the error: Error details: Values for st.button, st.download_button, st.file_uploader, and st.form cannot be set using st.session_state. Any suggestion?

chandrakalagowda commented 12 months ago

I have a similar issue too. I do not understand the difference between hydralit and streamlit-multipage https://docs.streamlit.io/library/get-started/multipage-apps/create-a-multipage-appe

Streamlit multipage is much easier to create. However when changing between pages(i.e apps) the apps loose the previous set values/work/graphs etc... This is of no use to create a multipage app if all the apps need to be restarted again.