UI Builder - List Refresh
hello in this ui builder bytes video we're going to take a look at how to refresh a simple list component from a client script so i can see in my ui builder here i've got uh this work management page it's pretty simple and straightforward i'll go ahead and show you what it does real quick so i'm going to type in the name of a task literally and i'm going to hit quick add task and supposedly it has created a task for me on the back end if i hit refresh it did create this new task that's the name of the task what i want to happen is i want this list to automatically refresh when i hit the quick add task button so to do that i am going to use the refresh requested property on the list component so i think this property is expecting a timestamp from me uh so what i'm gonna do is i'm gonna bind this to a client state parameter and then we're gonna populate that client state parameter from a client script and then we're gonna call that client script from my buttons click event so we're going to start by saying let's say list refreshed all right a string is fine it does not need an initial value uh so let's make that go away then we'll come down here and let's bind that too so we're going to find state and then list refreshed is the one that i just created so we'll click on that and so we've now bound the refresh requested property on the list to my client state parameter and then i'm going to populate that client state parameter via a client script so we're just going to add a list refresh client script and we're going to say api dot set state and i think we called that list refreshed let's take a look and make sure list refresh let's copy paste just so we can be sure and then the value of that uh is uh is kind of where the the magic comes in it's it's not that much magic but uh we want to set that to a time stamp and that time stamp is just going to be date dot now and we only need one comma all right so that so what happens we my client script runs it sets that property the property is bound to the component and the component gets this timestamp added to that filter property so the last thing we need to do is we need to add that so already when i click the button it's going to run my quick add task client script that creates a task and then we just need a second one to do a refresh so let's add list refreshed we'll save it and then open it again and we'll say this should refresh and there it is
https://www.youtube.com/watch?v=TiQIi9hLVug