Hi Helga,
I suspect the Data Grid 2 is retaining its pagination state even though the context of the Data View changes.
Have you considered using a helper entity instead of the Listen to Widget approach? You could use an on-click nanoflow on the List View to update the association of the helper object to the selected object and refresh it in the client.
This would give you more control over what happens whenever a new object is selected.
If you are working with Mendix 10.24 LTS or higher, ensure you are onDataWidgets 2.32.2 and not the updated version (DataWidgets 3.x..)
Hopefully this helps.
Kind Regards,
Raphael
Hi Helga,
This looks like a possible pagination state issue when the Data Grid 2 is nested inside a Data View whose context changes through a List View selection.
Refreshing the Data View object alone may not reset the Data Grid 2 pagination state.
I would recommend the following approach:
1. Check the Data Grid 2 data source
Make sure the Data Grid 2 retrieves records associated with the currently selected List View object.
For example:
List View (Parent)
|
v
Data View (Selected Parent)
|
v
Data Grid 2 (Associated Child Records)If you are using a microflow data source, verify that it retrieves the records for the current Data View object rather than a previously selected object.
2. Reset pagination when the selected object changes
Check whether your Data Grid 2 version exposes a Page Attribute under its pagination settings.
If available:
Create an Integer attribute, for example CurrentPage, in a page-helper entity.
Bind this attribute to the Data Grid 2 Page Attribute setting.
When the List View selection changes, reset CurrentPage to 0 before displaying the newly selected object's records.
Verify the page-index convention for your installed Data Widgets version.
3. Test with built-in pagination
Temporarily remove the Advanced Pagination widget and enable the standard Data Grid 2 paging buttons.
If built-in pagination works correctly, the problem is likely related to the Advanced Pagination configuration or synchronization with the grid.
4. Check whether the Data View is recreated
If the grid retains the previous pagination state after selecting a different List View item, test displaying the selected object in a separate Data View that is recreated when the selection changes.
This can help determine whether the issue is related to retained widget state.
5. Verify widget compatibility
Check that your Data Grid 2 and Advanced Pagination widgets are compatible with your Studio Pro and Data Widgets versions.
My recommendation:
Start by testing the built-in pagination without Advanced Pagination. Then check whether resetting the Page Attribute when the selected List View object changes resolves the issue.
Could you also confirm whether your Data Grid 2 uses a Database, XPath, Association, or Microflow data source? That will help narrow down the exact configuration.
Hope this helps! If you find this answer helpful, please mark it as the accepted answer.