Updating from an external database, committing to Mendix and updating a grid
Hi All, I am developing an app to display summaries of test results. There will be a list of versions, from which the user will be able to select one. When a version is selected, the user should see a list of summary data (pass rates etc) one row for each test framework used. I intend to store this data data in Mendix for fast access to old versions (a summary entity related to a version entity and a framework entity). Since the data can change during the day (even for recent older versions) I will need to fetch the current data from an external database before committing and displaying in Mendix. What suggestions do you have for implementation. I have tried: having a data grid of results by framework listen to a list view widget displaying version numbers, but then I cannot trigger a microflow from the version list to get the latest data having the data grid source be a microflow, but it seems that the selected microflow is not intended to be triggered by another widget putting the data into a non-persistable entity for display but a data grid cannot use a non-persistable entity as a data source storing current version in a non-persistable entity and using an xpath for the data grid source but it seems xpaths cannot reference non-persistables having the grid source be the summary entity, but I could not get associations to be available to constraints thanks
I would let the user decide when to update and keep an entity with the latest update time. You could use a datagrid for that with a dataview that listens to the grid. In the dataview have a button to update that specific data.
Other option would be to do a background update when opening the overview page and telling the user the data is being updated in the background. If you refresh your datagrid for instance each minute or so it will refresh the datagrid. You need to make sure though that that background job uses batches and do save those in seperate database transactions (community commons) so that the background job makes this data available when processed.
Hope this helps a bit.
Hi Ronald, (I’m using the submit answer pane so that I can insert an image)
This is my current setup:
Are you suggesting I replace the “version” list view with a data grid, or were you referring to the “summary” grid.
Currently, the list view displays the versions and calls the microflow on click. The microflow commits new summary data and has “refresh in client” set to “yes”. I was expecting that to update the datagrid since it has the summary entity as a data source.