Skip to content

Query on Switch component #6651

Answered by Lukas742
I506645 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @I506645

Since the Switch is a web-component developed by the UI5 Web Components team, I'm going to forward this question to the ui5-webcomponents repo.

Is it possible to capture and retain the state of the Switch when the user navigates between different pages?

Sure, like every other state it can be persisted. In this case you can use the checked property for this. There are different options depending on persistence level and framework you're using.

  • fully persist the state: Save the value of checked in the backend. This way the state will be persisted even across different browsers.
  • persist the state in the browser: With the localStorage you're able to keep the state stable inside…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by I506645
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants