The ReQuery operator lets you rerun the active Seeker query in a ViewModel and refresh its vSeekerResult collection; use it when users need current results after search values or underlying data have changed.
Use ReQuery to refresh Seeker results
Use ReQuery when the ViewModel already has an active Seeker search and you want to execute that search again.
Typical uses include:
- A Refresh action that reloads the current result list.
- Refreshing results after an action changes data that may be included in the current result set.
- Applying changed search-variable values to the current Seeker query.
ReQuery updates the ViewModel's vSeekerResult collection. It does not define the search expression; the active Seeker search logic defines what is returned.
Syntax
selfVM.ReQueryselfVM refers to the current ViewModel. Place the expression in the action that should refresh the results.
How it works
A Seeker is the search mechanism in a ViewModel. Its result collection is named vSeekerResult. When you execute selfVM.ReQuery, the ViewModel reruns its current active search logic and repopulates that result collection using the current values of its search variables and expressions.
For example, assume a ViewModel has a Seeker whose active expression uses a search variable named SearchText:
- The user enters a new value in
SearchText. - An action executes
selfVM.ReQuery. - The active Seeker search runs with the new value.
vSeekerResultis updated with the matching objects.
The same operation is useful after data changes elsewhere in the application. If the current Seeker results include an object that was edited, executing ReQuery retrieves the result set again according to the active search expression.
ReQuery compared with Search
Both operators use the ViewModel's Seeker search expressions and populate vSeekerResult. Choose the operator according to the behavior you need.
| Operator | Use it when | Result behavior |
|---|---|---|
selfVM.ReQuery
|
You want to run the current active Seeker search again, such as from a Refresh action or after a data change. | Reruns the current active search logic and updates vSeekerResult from the current variables and expressions.
|
| Search | You need the ViewModel's standard search behavior. | Triggers search functionality from the ViewModel's search expressions and populates vSeekerResult. Its standard behavior can move through search batches when the variables have not changed.
|
The important distinction is that ReQuery is a rerun of the current active query. It is the appropriate operator for a refresh scenario, where moving to another search batch is not the intended result.
Example: Refresh the current list
Create an action for a Refresh button or other refresh control and use this expression:
selfVM.ReQueryWhen the action runs, the ViewModel refreshes vSeekerResult according to the active Seeker expression. The result list therefore reflects the current state of the search variables and the data evaluated by that expression.
Things to check
- Ensure that the ViewModel has an active Seeker search before you use
ReQuery. - Ensure that the search expressions and any search variables contain the values you intend to use before executing the operator.
- Use
ReQueryto refresh the current result set; use Search when you require the ViewModel's standard search operation instead.
