The list is especially suitable for Opening the viewer for option selection. It allows to comfortably create user menus with variable and parametrized content. The menus can be of a global character with a list of all available objects in the application and/or the menus can be oriented only to a part of the application (technology) when using the logical groups.
|sFilter||(String) It allows to filter the objects and their viewers. For example "groups:menu;viewers:panel,alarm_state,alarm_history;viewertype:0;". The default 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 PmaWorkspace object viewer with workspace.
panel - The PmaPanel object viewer with user graphics.
report - The PmaReport object viewer with print reports.
alarm_state - The PmaAlarmGroup object viewer - alarm states.
alarm_history - The PmaAlarmGroup object viewer - alarm history.
event - The PmaEventGroup object viewer - event history.
viewertype (optional) - The filter type based on the fact whether the viewer is designed for displaying in 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 option.
1 - Only viewers designed for the local application.
So far it is not possible to define that some viewers (e.g. in the PmaPanel 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 default 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 CreateView method). This column is always stated first for the purpose of displying selectable options 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 option does not need to be defined by default. See the "PmaRoot > Application > Main language of runtime" configurator.
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 CreateView method) and in the second column, there is a locatized text connected with corresponding object viewer (for displaying 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 Pmg object event (e.g. in the PmgButton.onButtonUp event). The PmgRoot.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;", "", "");
The list will include also the first row with column names.
The localised texts will be evaluated in English language.
var a = Pm.FindViewers("groups:menu;viewers:alarm_state;", "", "columns:path,title,alstate3,alstate2,alstate1,alhoot;lang:en;");