UI Builder: Repeaters bound to Client State Parameters don't refresh when the Parameter is updated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 01:16 PM
I have a repeater bound to a client state parameter "selected_projects", which is initially given a value of an array of length 1. The repeater is correctly showing 1 "row" of the contained components. I'm trying to update this client state parameter by using 'api.setState("selected_projects", ["blah", "test"]);'. This is working correctly, I validated that the client state parameter is being updated. However the repeater component doesn't seem to re-evaluate once the client state parameter updates, It will only ever show 1 row. Is there a way to manually tell a repeater component to refresh?
Troubleshooting steps I've taken so far: I've bound a client script to a button component such that when the button is pressed, an element is pushed to the "selected_projects" array. I added a log statement, and it is getting updated correctly: everytime I press the button, the length of the array increases. I then changed the "Data Array" property of the repeater to be scripted:
However, when I press the button component I added, the "Test" doesn't get logged. It is only logged when the page loads, not when the client state parameter is updated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 10:55 PM
Even I have the exact same issue. Can someone please suggest a solution to this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 11:20 PM
Hey @Noah Boltik @Akshay Pasunuri
Did any of you guys found a solution for this? It is 2024 and I am in Washington DC and still the same issue.
regards,
rahman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:10 AM
No @Rahman4 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 04:39 PM
@Akshay Pasunuri I managed to sort out that issue this morning. I needed to do a "Refresh - Data Resource" after updating the Client State Paramter and then the repeater got working. You basically need to Refresh the data resource of the repeater. My scenario was when a user is selecting a group my repeater need to show all the members of that group. I am posting it here in case someone has the same issue. Mark it as answer if it fixes your issue.
So this fixed it: