Update cookies preferences
Promotic

FindViewers - method of the Pm object

Description:
Returns the list of object viewers according to selected criteria.
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 application objects and/or the menus can be oriented only to a part of the application (technology) by means of logical groups.
Syntax:
Array FindViewers(String sFilter, String sExpression, String sParams)
Parameters:
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;"
groups - Filtering according to the viewer (object) logical group. For example "groups:menu;".
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 viewers is designed for displaying in the local application or for the Web.
If not defined, then it is configured automatically, based on the fact whether this method is called in the local application or on the Web - and 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.
2 - Only viewers designed for the Web.
In the output list, only viewers enabled for the Web sharing, will be displayed. The default way for enabling the object (e.g. PmaPanel) for the Web is in the "Enable as Web component" configurator on the "Web server" tab.
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 column names (localized texts) while being viewed.
title (default) - The first row of the output list will contain the column names (localized texts) while being viewed.
columns (optional) - Column identifier list of the output list (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 national language to be used for evaluated localized 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 - usually this option does not need to be defined.
See the "PmaRoot > Application > Main language of runtime" configurator.
Return value:
The result is 2-dimensional array (PmArray object for JavaScript or Array data type for VBScript), where each row represents object viewer found.
Note:
The rows represent each object viewer found according to the filtering criteria. The columns are defined by the columns item in the sParams parameter.
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 localized text connected with corresponding object viewer (for displaying in the menu). It corresponds to the setting of "columns:path,title;", which is the default value of this item. The first row will contain the header (localized text) with column titles. It corresponds to the setting of "headers:title;", which is the default value of this item.

This method is also functional in Web panels. Calling this method on the Web will cause the internal XML communication with the server, so in fact the method is called on the server and only the input and output data are transmitted by the communication.
Example1:
Obtains the list of all user graphic viewers, that are offered as a part of a logical group menu, with a basic representation (path to the viewer and a localized user name). The list will include also the first row with column names.
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.
JavaScriptVBScriptSelect and copy to clipboard

var aViewers = Pm.FindViewers("groups:menu;viewers:panel;", "", "");
Example2:
Obtains the list of all alarm states viewers, that are offered as a part of a logical group menu, with a detailed report of alarm counts in each possible state.
The list will include also the first row with column names.
The localized texts will be evaluated in English language.
JavaScriptVBScriptSelect and copy to clipboard

var aViewers = Pm.FindViewers("groups:menu;viewers:alarm_state;", "", "columns:path,title,alstate3,alstate2,alstate1,alhoot;lang:en;");
Next examples:

History:
Pm8.00.00: Created
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- FindViewers
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.