Resetting next experience components in UI Builder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 08:46 AM
I have built an interface using UI Builder. In this interface I have a Select component that I fill with our stockroom list. When the user selects a stockroom and presses a button an asset that they have entered will get set to that stockroom.
All this works fine.
Now after the button is pushed and the script runs to do the stockroom setting I would like to clear the stockroom selection component. Actually setting it back to the pristine fresh page load state would be ideal.
Can the select component be reset somehow?
- Labels:
-
UI Builder : Next Experience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 12:31 AM
@Steve Stivers1 , yes the Select component can be reset. Follow the below steps.
1. create a state parameter of string type. eg selectval
2. add "Select selected item set" event mapping to select component as below screenshot. And add the event handler "Update client state parameter". Select the state parameter you have created and value as @payload.value by dynamic mapping.
3. Now go to config tab of Select component and set Selected Item property as "@state.<yourPageparamter>".
4. Now go to your button component that you have created. Add event handler on click event and reset the state parameter to empty. so once the button is clicked, the selected item value gets reset to empty value. Find screenshot below.
The above setup should help you with your requirement.
Please mark as correct if it helps.
Thanks.