OpenView - method of the PmaPanel object
Syntax:
Empty OpenView(String sObjectPath, [String sOptions], [String sParams], [PmMap oExtra])
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 the KeyVal format, for example "target:_blank;modal:1;".
For detailed description see sOptions. |
sParams | [optional] (String) The data transferred to the object that is to be viewed by the corresponding viewer.
Entries are in the KeyVal format, for example "name1:value1;name2:value2;".
For detailed description see sParams. |
oExtra | [optional] (PmMap) Additional entry for the viewer. The data are defined here by creating properties in the PmMap 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:
- etc.
This method is also functional in
Web panels.
All examples listed below are in the
JavaScript language. It is presumed that
OpenView method is called in the
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 better to use the
PmaWorkspace.OpenView method.
The example of the window opening with defined parameters:
Opens another panel in a new window and set the value of parameters nmb and idx.
JavaScriptVBScriptSelect and copy to clipboard
pMe.PmPanel.OpenView("/Panel3", "target:_blank;", "pars:{nmb:2;idx:5;}");
pMe.PmPanel.OpenView "/Panel3", "target:_blank;", "pars:{nmb:2;idx:5;}"
The example of the window opening and placing according to the Pmg object position:
Opens a window at the position of the Pmg object that is used to call OpenView method.
JavaScriptVBScriptSelect and copy to clipboard
var sPos = "view," + pMe.X + "," + pMe.Y + ";";
pMe.PmPanel.OpenView("/Panel3", "target:_blank;" + sPos, "");
Dim sPos
sPos = "view," & pMe.X & "," & pMe.Y & ";"
pMe.PmPanel.OpenView "/Panel3", "target:_blank;" & sPos, ""
The example of the alarm viewer opening:
Opens the viewer of alarm state ("/alarms" object) in the main frame of the application by the button in 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;");
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");
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");
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, 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\");");
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 the panel with the trend viewer. The trConnect parameter contains the group-IDs and variable-IDs connected automatically when opening the panel.
JavaScriptVBScriptSelect and copy to clipboard
pMe.PmPanel.OpenView("/PanelTrend", "target:main;", "pars:{trConnect:group0,temper,group0,pressure;}");
pMe.PmPanel.OpenView "/PanelTrend", "target:main;", "pars:{trConnect:group0,temper,group0,pressure;}"