Promotic
WikipediaLinkedInYoutubeTwitterFacebook

OpenView - method of object PmaPanel

Description:
The method opens viewer of another object.
Syntax:
Empty OpenView(String sObjectPath, [String sOptions], [String sParams], [PmMap oExtra])
Calling:
oPanel.OpenView sObjectPath, sOptions, sParams
Parameters:
sObjectPath(String) Path (relative or absolute) to the object or component whose viewer will be opened.

For detailed description see sObjectPath.

sOptions[optional] (String) The parameters transferred to the viewer. These define where and how to open the viewer.

Entries are in KeyVal format, for example "target:_blank;modal:1;".

For detailed description see sOptions.

sParams[optional] (String) Parameters transferred to the object that is to be viewed by the corresponding viewer.

Entries are in KeyVal format, for example "name1:value1;name2:value2;".

For detailed description see sParams.

oExtra[optional] (PmMap) Additional entry of viewer behavior. The items are defined here by creating properties in the PmMap type object (contrary to previous parameters sOptions and sParams where the entry is added in text form) - this way it is possible to transfer general values (not only text).

For detailed description see oExtra.

Note:
For opening the viewer the permission must be set in the opening object. For example:
- for the PmaPanel object: permission PanelOpen or WebRead
- for the PmaAlarmGroup object: "WebRead" permission
- etc.
 
This method is also functional in Web panels.
 
All examples listed below are in JavaScript language. It is presumed that the OpenView method is called in Pmg object event (for example in the onButtonUp event of the PmgButton object).

These examples are functional for local panels and for Web panels.

If it is needed to open a new window directly from application event (for example in objects PmaTimer, PmaKey ..), then it is recommended to call the PmaWorkspace.OpenView method.

The example of window opening with defined parameters:
Opens another panel in a new window and set the value of the parameters nmb and idx.
JavaScriptVBScriptSelect and copy to clipboard

pMe.PmPanel.OpenView("/Panel3", "target:_blank;", "par:nmb=2;par:idx=5;");
The example of window opening and placing according to the Pmg object position:
Opens the window at the position of the Pmg object that is used to call the OpenView method.
JavaScriptVBScriptSelect and copy to clipboard

var sPos = "pos:view," + pMe.X + "," + pMe.Y + ";";
pMe.PmPanel.OpenView("/Panel3", "target:_blank;" + sPos, "");
The example of alarm viewer opening:
Opens alarm viewer ("/alarms" object) in the main frame of the application from the button of the panel. Alarm viewer can be opened in the application and also in Web client.
JavaScriptVBScriptSelect and copy to clipboard

pMe.PmPanel.OpenView("/alarms", "target:main;");
//or
pMe.PmPanel.OpenView("/alarms/#state", "target:main;");
The example of the PmaWebDir object viewer opening:
Opens Web browser and displays the MainPage.htm file, that is offered by the PmaWebDir object.
JavaScriptVBScriptSelect and copy to clipboard

pMe.PmPanel.OpenView("/Web/WebDir", "target:_blank;", "file:MainPage.htm");
The example of Web browser opening:
Opens Web browser and displays defined HTML internet page (https://www.promotic.eu).
JavaScriptVBScriptSelect and copy to clipboard

pMe.PmPanel.OpenView("/#glob/webbrowser", "target:main;", "url:https://www.promotic.eu");
Example of opening a HTML page provided by another PROMOTIC application:
Opens a Web browser and displays the defined HTML page provided by another PROMOTIC application. The login credentials can be included in the URL address, but the password must not be empty:
JavaScriptVBScriptSelect and copy to clipboard

pMe.PmPanel.OpenView("/#glob/webbrowser", "target:main;", "url:http://username:pass@192.168.1.25:82/workspace/main.htm");");
Example of opening a trend viewer panel:
Opening a panel with trend viewer. The trConnect parameter contains the group-IDs and variable-IDs connected automatically when the panel is opened
JavaScriptVBScriptSelect and copy to clipboard

pMe.PmPanel.OpenView("/PanelTrend", "target:main;", "par:trConnect=group0,temper,group0,pressure;");
PROMOTIC 9.0.7 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice