You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs say that the accepted type for value is a string, which is what one could expect given the widget's name. However it actually accepts any type (value = param.Parameter(default=None)), and uses the string representation of the object to display it. This can have some undesired consequences, such displaying Title: None for None or Title: for functions (and classes) as they're turned into <function ...></function> in the Div.
Updating value is as simple as st = StaticText(name='Name', value='Bob'); st.value = 'Bill'. But it's also possible to do it with st.value = '<b>Name</b>: John. This is not documented, it's tested however.
I think 1. should be fixed; it might be too late to fix 2. but there could more info in the docs; 3. should not really be supported although it's likely no one has ever used that or will ever do.
The text was updated successfully, but these errors were encountered:
While having a look at #2663, I noticed a couple of things that could be fixed/clarified about the
StaticText
widget.value
is not given, the widget doesn't displayname
. It renders as an empty Div.value
is a string, which is what one could expect given the widget's name. However it actually accepts any type (value = param.Parameter(default=None)
), and uses the string representation of the object to display it. This can have some undesired consequences, such displayingTitle: None
forNone
orTitle:
for functions (and classes) as they're turned into<function ...></function>
in the Div.value
is as simple asst = StaticText(name='Name', value='Bob'); st.value = 'Bill'
. But it's also possible to do it withst.value = '<b>Name</b>: John
. This is not documented, it's tested however.I think 1. should be fixed; it might be too late to fix 2. but there could more info in the docs; 3. should not really be supported although it's likely no one has ever used that or will ever do.
The text was updated successfully, but these errors were encountered: