I would like to use a link_button instead of a button in my app but I want to capture if the link_button has been pressed and if so, execute some action.
The reason I need a link_button is because it does not force a rerun.
Basically I am asking of there is a way to “wrap” the link_button component and add basic functionality to return true or false if it has been clicked.
If I understand it correctly, the beauty of link_button is it doesn’t force a rerun.
I have a scenario where I have a series of buttons right now (st.button), each button’s label is a URL and if a button has been pressed, it opens a tab with the URL but also does something that is UI independent (send feedback to an S3 bucket on AWS). I want to do the same but with a link_button.
Currently, the rerun forced by st.button is destroying the layout of the container all these buttons are a part of. If I do the same container with link_button(s) - the layout is undisturbed because there is no rerun (is my understanding). However, with link_button I lose the ability to submit the feedback because I don’t know that a link_button has been clicked.
That’s kind of what I said, isn’t it? I am looking for a way to “enhance” link_button to return a true/false if it was clicked. Or are you saying as soon as there is “feedback” from a component - rerun is forced?
Is there a way to “attach” javascript functions to existing components “live” - components like link_button or do I need to write a whole new link_button implementation of my own?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.