Hi Derek,
If there are values that need to be taken into account when refreshing you can set hidden values with the values selected and the data input and set them on the OnClick().
For having a filter value set to the very same value when reloading you need to have a hidden filter linked to the same hierarchy, and just copy the value of the ViewParameters in the Click event of the button, and then call the OnLoad(), something like this:
// Identify the view parameters
var vp1 = this.parentView.control.getViewParameterByName(“MyListFilterViewParameter”);
var vp2 = this.parentView.control.getViewParameterByName(“MyHiddenListFilterViewParameter”);
// Remove all values and tokens from the hidden parameter value
vp2.parameterValue.clearTokens();
vp2.parameterValue.clearValues();
// Set Filter #2 to have the same values as Filter #1
vp2.parameterValue.values = vp1.parameterValue.values;
// Set the last modified time so this parameter takes precedence over any others
vp2.invalidateParameterValueLastModifiedTime();
// Update all the connected adapters with the newly modified values
// Includes data visualizations and filter controls
vp2.refreshAllAdapters();
hiddenParameterTextBox2.control.value = parameterTextBox1.control.value; // where parameterTextBox1 is the one set by your end-user (if it’s a string, but it works the same for a number, the only thing is that both filters have to have the same format)
// Then launch the OnLoad()
myTable.loadData();
And in the OnLoad() of MyTable, you just do the reverse, copy vp2 value to vp1, and copy hiddenParameterTextBox2 value to parameterTextBox1, then just refresh the adapters.
By the way you’ll have to deal with null values at least for the first time the OnLoad() is called (which can be solved by a if-else…).
I hope this helps,
Olivier