We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on_change
The on_change function of selector is not working.
The on_change function of selector should work.
Test code:
import taipy.gui.builder as tgb from taipy.gui import Gui def on_change(state, var, val): print(state) print(var) print(val) if __name__ == "__main__": collection_names = ["collection1", "collection2", "collection3"] with tgb.Page() as page: tgb.selector( label="Collection", lov=";".join(collection_names), dropdown=True, on_change=on_change, ) Gui(page=page).run( dark_mode=False, debug=True, use_reloader=True, port=5001, )
No response
macOS 14.5 (23F79), Chrome Version 125.0.6422.142 (Official Build) (x86_64)
Chrome
Mac
taipy==3.1.1 taipy-config==3.1.1 taipy-core==3.1.1 taipy-gui==3.1.2 taipy-rest==3.1.1 taipy-templates==3.1.1
The text was updated successfully, but these errors were encountered:
Hi, your selector is not bound to any variable. This behavior is normal.
I have bound your selector to a variable called selected_collection. Try this code and tell me if this works:
import taipy.gui.builder as tgb from taipy.gui import Gui def on_change(state, var, val): print(var) print(val) if __name__ == "__main__": collection_names = ["collection1", "collection2", "collection"] selected_collection = None with tgb.Page() as page: tgb.selector( value="{selected_collection}", label="Collection", lov=collection_names, dropdown=True, on_change=on_change, ) Gui(page=page).run( dark_mode=False, debug=True, use_reloader=True, port=5001, )
Sorry, something went wrong.
@FlorianJacta Thanks, that works!
Great to hear! You can now access your real-time variable selected_collection in any callback.
FlorianJacta
No branches or pull requests
What went wrong? 🤔
The
on_change
function of selector is not working.Expected Behavior
The
on_change
function of selector should work.Steps to Reproduce Issue
Test code:
Solution Proposed
No response
Screenshots
No response
Runtime Environment
macOS 14.5 (23F79), Chrome Version 125.0.6422.142 (Official Build) (x86_64)
Browsers
Chrome
OS
Mac
Version of Taipy
taipy==3.1.1 taipy-config==3.1.1 taipy-core==3.1.1 taipy-gui==3.1.2 taipy-rest==3.1.1 taipy-templates==3.1.1
Additional Context
No response
Acceptance Criteria
Code of Conduct
The text was updated successfully, but these errors were encountered: