Make Streamlit table results hyperlinks or add radio buttons to table?

Hi, I agree with the others that the code is awesome! Thanks all of you. :partying_face:
I have a specific issue with the row opening mechanics demonstrated in the following video:
streamlit-app-2022-11-03-21-11-41

I guess this is because the selectbox triggers an execution of the script and thus resets the status of the button? MWE:

import streamlit as st

cols   = st.columns(2)
fields = ["id", "content"]

# header
for col, field in zip(cols, fields):
	col.write("**"+field+"**")

# rows
for idx, row in zip([1,2,3],["test1", "test2", "test3"]):
	
	col1, col2 = st.columns(2)
	col1.write(str(idx))
	
	placeholder = col2.empty()
	show_more   = placeholder.button("more", key=idx, type="primary")

	# if button pressed
	if show_more:

		# rename button
		placeholder.button("less", key=str(idx)+"_")
		
		# do stuff
		st.write("This is some more stuff with a checkbox")
		temp = st.selectbox("Select one", ["A", "B", "C"])
		st.write("You picked ", temp)
		st.write("---")

Does someone have an idea how to stay within a selected row even when there is a new widget?

Thank you very much.

1 Like