ParamsBox.refreshAll

Syntax

refreshAll();

Description

The refreshAll method refreshes dictionary parameters container.

Example

To execute this example, the page must contain the DictionaryBox component named dictionaryBox (see Example of creating the DictionaryBox component ). Get a parameter from the parameters container, show type of its instance, data source name and key. Define parameters of opening and reopen the dictionary using selected parameters of opening. Process the ParamChanged event. Change name of parameters container data source and refresh it:

// Get dictionary data area
var area = dictionaryBox.getDataArea();
// Get component used to work with parameters
var paramBox = area.getActiveParamBox();
// Get parameter
var param1 = paramBox._Parameters._Items[0];
// Show type of parameter instance
console.log("Parameter instance type: " + param1.getInstance().getTypeName());
// Show value of parameter key
console.log("Parameter key: " + param1.getKey());
// Show data source name
console.log("Name of parameter data source: " + param1.getSource().getName());
// Parameters of opening
var openArgs = {
    k: 8209,
    id: "ENDDATE",
    dt: 4,
    n: "End date",
    binding: "UI='DateTimePicker'",
    vis: true,
    value: null,
    attribute: {
        k: 2023
    }
};
if (!param1._LinkedDict) {
    console.log("Linked dictionary is not available");
} else {
    // Reopen dictionary using a link with the specified parameters of opening
    param1.reopenLink(openArgs);
}
// Process the ParamChanged event
paramBox.ParamChanged.add(function (sender, eventArgs) {
    console.log("ParamChanged event initialized");
});
// Get data source
var source = paramBox._Source;
// Change data source name
source.setName("SourceName");
// Set modified data source
paramBox.setSource(source);
// Refresh the component used to work with parameters
paramBox.refreshAll();

As the result, name of parameters container data source is changed and the data source is refreshed. The browser console shows instance type, key value and name of parameter data source as well as the message informing that the linked dictionary is not available:

Parameter instance type: DateTimePicker

Parameter key: 2023

Name of parameter data source: Time units

Linked dictionary is not available


Manually change value of the Actuality Date dictionary parameter.

After that the browser console shows a message on calling the event that changes parameter value:

ParamChanged event initialized

See also:

ParamsBox