State parameter modified by Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 03:29 AM
Hi,
I need to introduce in UI Builder functionality like this:
List Selector when selected/deselected can add "filter" and Pill selected/deselected can add "filter". I need to introduce state parameter "activeFilters" which will keep information about active filters. If user add new filter by clicking in list selector the corresponding Pill needs to be selected. So I need full synchronization between those 2 UI components based on state parameter.
I think I can handle this by User Script but I don't know how can I get/set value to state parameter in User Script. What do You think is this possible to solve?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 06:15 AM
This sounds fairly complex, but you can set the state using the following in a page/client script:
api.setState('stateVariableName', 'stateVariableValue');
and read the state using the following:
api.state.stateVariableName