I came across a strange issue with a Data View using a Pager Add Rows control resetting the number of documents displayed after a partial refresh. In this post, I’ll explain the scenario where I saw the issue and show the simple solution that fixed the problem.
The Problem
I have a Data View that starts with 20 rows and uses a Pager Add Rows control to add 10 more rows at a time.
Within the summary facet, there’s an action that can take place, which runs a minimal script and then performs a partial refresh with partial execution on the summary section.
This *seems* to be fine when performed within the first set of rows, but I noticed that if additional rows are added to the display and then the action is run in any one of the rows, the action runs successfully, but the data view is reset to only display the initial set of 20 rows.
If the action was taken on a row after the initial 20, I can add rows again and see that the action has taken place and the partial refresh has occurred as designed.
The Fix – Changing the ‘State’ Property
I tried making a number of changes to partial refresh and partial execution settings, but none of them fixed this issue.
Ultimately, the issue was fixed by a simple property change. The Pager Add Rows control has a state
property (All Properties > basics > state)
When set to true
, it stores the view state on the server.
This did the trick. It allows the row count to be preserved between partial refreshes by storing it on the server.
