How to reload data table in modal but keep modal open?

Hi, I'm using Bonita 2021.2

I'm following project Vacation Management Example.

I have a data table to manager customers, when i select each row, it will open a modal. In the modal, i have a form and a data table to manager multiple customer contact information.

My problem is when i creating a new contact, i don''t know how to reload a table other than using function target URL on success. It reload the whole page, which is really annoying. How to reload data table when insert a row in modal but keep modal open?

Thanks

Hello, 

the best way to reload a table without reloading the page is to trigger the api call used to fill this table.

For example, we can imagine a Modal containing a list of users, and a button to create a new user.

- So the list of users need to be based on an External API using an url based on a variable that you could call "timeStamp"

URL = ../API/identity/user/?p=0&c=100&t={{timeStamp}}

- The button "create a new user" just need to bind success response value to a variable like "createdUser"

- and finally you need to create a variable "refreshList" of type javascript expression that update the "timeStamp" when a new user is created, it could be something like:

if($data.createdUser!==null){
    $data.timeStamp = new Date().getTime();
    $data.createdUser=null;
}

this code will update the "timestamp" of the API call used to feed the "list of users", so it will trigger the API call and automatically refresh the table.

Hope this helps,

Julien.

 

 

 

 

Thank you, it's worked

 

happy to see your feedback yes

nice to know when we were able to help.