data = Pm.FindViewers(sFilter, sExpression, sParams)
|sFilter||(String) Allows to filter the objects and their viewers. For example "groups:menu;viewers:panel,alarm_state,alarm_history;viewertype:0;". The preset value is "viewers:all;viewertype:0;"|
viewers (optional) - Filtering according to the viewer types. For example "viewers:panel,alarm_state,alarm_history;".
all (default) - Any viewer.
workspace - The PmWorkspace object viewer with workspace.
panel - PmPanel object viewer with user graphics.
report - PmReport object viewer with print reports.
alarm_state - PmAlarmEvent object viewer - alarm states.
alarm_history - PmAlarmEvent object viewer - alarm history.
event - PmAlarmEvent object viewer - event history.
viewertype (optional) - The filter type based on the fact whether the wiever is designed for local application or for the Web.
If not defined, then it is configured automatically, based on the fact whether the method is called in the local application or on the Web - therefore normally, it is not necessary to define this.
1 - Only viewers designed for the local application.
So far it is not possible to define that some viewers (e.g. in the PmPanel objects) are not available for the local usage and therefore this option will not filter anythig.
|sExpression||(String) Reserved, must contain an empty string ("").|
|sParams||(String) Specifies the format of output data. For example "headers:title;columns:path,title;lang:cs;". The preset value is "headers:title;columns:path,title;"|
headers (optional) - Specifies whether the output list will contain (on the first row) also the localised column names while being viewed.
title (default) - The first row of the output list will contain the localised column names while being viewed.
columns (optional) - Column identifier list of the output list (the separator is comma ',').
path (default) - Full path to the object viewer (with posible extra details, for example #state, allowing to open the viewer by the Object viewer open method). This column is always stated first for the purpose of displying itself by the SelectionDialog method and it is invisible when displaying the menu. The next columns are then visible in the menu.
title (default) - The localized text connected with the viewer of the (Title) object found, to be listed in the menu.
alstate3 - The number of alarms in the state active unacknowledged (red) in the alarm group.
alstate2 - The number of alarms in the state active acknowledged (yellow) in the alarm group.
alstate1 - The number of alarms in the state inactive unacknowledged (blue) in the alarm group.
alhoot - The number of beeping alarms in the alarm group.
lang (optional) - Specifies the language to be used for evaluated localised texts. Language is determined with a text identifier, e.g. "en", "de", "ru" etc. - see Fully supported languages in the PROMOTIC system. If not set, then the language currently used in the viewer will be used - this entry does not need to be defined by default. See the configurator "PmRoot > Application > Main language of runtime".
The basic format of the output list is as follows: the first column contains a full path to the found object viewer (with posible extra details, for example #state, allowing to open the viewer by the Object viewer open method) and in the second column, there is a locatized text connected with corresponding object viewer (to be displayed in the menu). It corresponds with the setting of "columns:path,title;", which is the default value of this item. The first row will contain the localized header with column titles. It corresponds with the setting of "headers:title;", which is the default value of this item.
This script is called in the graphic item event (e.g. in the PmiButton.onButtonUp event). The PmiRoot.ClientType properties can be used, in order to offer all the local panels will be offered in the local panel and the Web panel will offer all Web panels.
var a = Pm.FindViewers("groups:menu;viewers:panel;", "", "");
var a = Pm.FindViewers("groups:menu;viewers:alarm_state;", "", "columns:path,title,alstate3,alstate2,alstate1,alhoot;lang:cs;");