How to automatically refresh a data grid after importing using REST service of HospitalHR from Crash Course in Mendix Academy?

0
In the crash course, you are told to create an import button in the navigation and link the button to a microflow that GETs the department and employee data from HospitalHR using REST. I have successfully done this and I see it is imported and displayed in my data grid but I only see it after refreshing the page and it takes me to the home page first. How can I refresh the data grids automatically when I am viewing either the employee overview or the department overview after clicking the import button?   Adding a synchronize activity to the microflow does not work. The data grid has an option to set "refresh time (in seconds)" but when I set it to 1 second, and clicking the import button - it doesn't refresh the data grid. Adding a "change object" activity in the microflow (to change the department/employee object/list -> then select refresh in client) does not work when i give the department object as parameter and gives the error "parameter does not match available arguments". How do I pass the department object correctly then? I also tried putting the import button inside the data grid - which passes the department object as a parameter correctly but when I run the app, a row needs to be selected to press the button.
asked
1 answers
1

Hi Andini,

You can create an NPE. and use a dataview of the NPE as the parent of the datagrid, once you click on the import button, you can use a change object activity, and refresh the NPE on the page, to reload it on the page.

THis will re-render the datagrid, and will start showing you the new data.

 

Let me know if you have any issues,

Hope it helps!

answered