OpenView - method of object PmPanel

The method opens viewer of another object.
OpenView(sObjectPath As String, [sOptions As String], [sParams As String], [oExtra As PmMap])
oPanel.OpenView sObjectPath, sOptions, sParams
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 format PmNamedValues, 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 format PmNamedValues, 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 (this is a difference compared 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.

For opening the viewer the permission has to be set in the opening object. For example:
- for PmPanel object there is permission PanelOpen or WebRead
- for PmAlarmEvent object there is permission WebRead
- etc.
The method can also be called in the graphic item events for Web Panels.
All examples listed below are in JavaScript language. It is presumed that the OpenView method is called in graphic item event (for example in the onButtonUp event of the PmiButton graphic item).

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

If it is needed to open a new window directly from application event (for example in objects PmTimer, PmKey ..) then it is recommended to call the PmWorkspace.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.
pMe.PmPanel.OpenView("/Panel3", "target:_blank;", "par:nmb=2;par:idx=5;");
The example of window opening and placing according to the graphic item position:
Opens a window at the position of the graphic item that is used to call the OpenView method.
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.
  pMe.PmPanel.OpenView("/alarms", "target:main;");
  pMe.PmPanel.OpenView("/alarms/#state", "target:main;");
The example of PmWebDir object viewer opening:
Opens Web browser and displays the MainPage.htm file, that is offered by the PmWebDir object.
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 (
pMe.PmPanel.OpenView("/#glob/webbrowser", "target:main;", "url:");
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice