Open ElmiraOn opened 10 months ago
Added the functionality. However double click is required as state session attributes cannot be used for buttons in streamlit for automatic update the state of buttons.
Looked into different methods to allow disabling and enabling buttons without the need for double click. The existing methods for such purpose (e.g. toggle) do not work for our project as the initial state of the buttons in such scenarios is not dependant on a flag (existence of relation in our case) for the initial state of the button.
One method suggested here that was not tried. in this method, instead of a list, we could use the df. however, implementing this method suggests changing the structure of how the data frame is being handled currently and is likely to not work.
Use the solution suggested in the previous comment to modify the dataset (csv file) using the st.session_state which would allow a smoother transition between add/ delete relation buttons.
disable the delete relation button when the relation does not exist and enable it when it does.
Disable the add-relation button when it exists and disable it when it does not.