Depending on the Automatic Refresh object property value, a grid control in the web form is automatically loaded when filters related with it are entered.
An "Automatic refresh" is done when any of these change:
- Variables/Attributes/Properties which are part of both of the object and grid conditions.
- Variables/Attributes which are input of the object's (or grid's) Load event.
- Variables/Attributes/Properties assigned in the Start event and included in the grid (the purpose is not to lose its value upon refreshing the grid).
The purpose of the Automatic Refresh property is to give the option of deciding whether to load the grid automatically or to have the end user enter the filters and press a "Refresh" button afterwards.
The possible values for this property are as follows:
- When variables in conditions change (default value)
As the user enters filters, the grid is automatically refreshed without the user having to click a "Refresh" button.
This functionality is solved using Ajax, so only the necessary information travels from the server to the client (only the grid's filtered records).
Suppose you have a grid which loads different products, and the following condition:
ProductDescription like &ProductDescription when not &ProductDescription.IsEmpty();
The variable &ProductDescription is in the form. When it's empty, no filters are applied, so all the records are shown:
As the user enters some key letters in the &ProductDescription filter, the grid automatically filters the corresponding records without the user having to click a "Refresh" button. The refresh is done automatically.
Note: Depending on the data type of the filter, and the web control used for the filter, the condition will be applied as it is being entered or when leaving the field. In the case of filters in edit controls, for character filters, they are applied as the user enters them. For date, datetime, and numeric fields, conditions are evaluated when leaving the field. In the case of filters in combo boxes, dynamic combos, conditions are evaluated when leaving the field. For Checkboxes and radio buttons, conditions are evauated when the value is changed. Note that only the grid refreshes, not the rest of the page, so if a checkbox is part of the filters, when checking, its start, refresh and load events won't be executed (because only the grid is refreshed by AJAX).
Let's consider the same example as above, but in this case we add another filter, which is a dynamic combo box.
ProductDescription like &ProductDescription when not &ProductDescription.IsEmpty(); ProductCategoryId = &ProductCategoryId when not &ProductCategoryId.isempty();
As the &ProductDescription is being entered, the conditions are evaluated taking into account that there is another condition to be evaluated, so the records shown satisfy both conditions at the same time.
In this case, the Automatic Refresh property is set to "No".
Users will have to click on the "Go" button in order to apply the filters they entered. The conditions will be evaluated as soon as that button is pressed. In this particular case, the button is associated to the "Refresh" event.
User action is needed to make the grid load the records that satisfy the conditions. Depending on whether the grid has a base table or not, there are two possible user actions to make the grid refresh after entering the filters:
Refresh event is always executed on the server, be it automatic or not.
How to apply changes? Rebuild all objects