have viewer of the corresponding content. This chapter describes the viewer opening procedures in the running application (in runtime).
2)
Dynamically in the script by methods OpenView:
The set of these methods allows to open any viewer in the frame of the
PmaWorkspace object, in the
PmgFrame object, or as a separate window. Method is very handy and therefore it has been implemented into multiple objects:
The method is asynchronous, i.e. the method only activates the opening of corresponding viewer (eventually closing the previous viewer), but after the method is completed the viewer may not yet be open.
Displaying the content viewer of any object is managed the unified way. Generally
sOptions
(
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 viewers of objects
PmaPanel and
PmaReport: The static default values
sOptions can be set in the "
PmaPanel > Panel > sFramePars default value" configurator or in the "
PmaReport > Report > sFramePars default value" configurator.
In this case the static default setting of the object is combined with the entries provided dynamically.
If the same information is present on both places, then the dynamical information provided at viewer opening is preferred by the system.
target:xx; - Specifies in which frame will viewer be opened.
If not set, then the following settings are used as default:
- if the window is open as modal (is set "modal:1;"), then "_blank" is set.
- if is opened from the
PmaPanel object, then
"_self" is set.
- if is opened from the
PmaWorkspace object, then the main frame identifier of the workspace is used (defined in the "
Default frame" configurator).
- if is opened from the
PmgFrame object, then the viewer displays in the
PmgFrame object).
frameid - The new viewer is opened
in the PmaWorkspace object in the frame with
frameid identifier.
_blank - The new viewer is opened in a new window.
_blank.blankid - Identifier of the independent or modal window.
If a window with
blankid identifier already exists then the new viewer opens
in current window, otherwise it opens
in a new window.
The meaning of the identifier:
- Prevents opening a large number of windows with the same identifier.
- It allows this window to be referenced, for example:
- the method
Pm.WndOper(0, "_blank.xy", 10) closes the window with
xy identifier.
This is a system name, so it must contain only alphanumeric and must not contain any diacritics (i.e. national dependent characters), spaces and first character must not be a number.
_self - The new viewer is opened in the current window (in the frame) and the viewer, over which the method was called, is closed.
scrollbar:nn; - Specifies whether the window will have the scrollbars and allows moving the contents, if the panel size is greater than window size, the panel is inside.
0 - The scrollbars will never be displayed and therefore the window content cannot be scrolled.
It is handy for example for very narrow "toolbar" type windows.
1 (default) - The window displays the scrollbars and allows to scroll the panel, if the panel size is greater than window size, the panel is inside.
refresh:xx; - Only for opening the viewer of the
PmaPanel object. Specifies whether the panel has the automatic refresh according to the globally set system period or the panel has its own refresh rate. For now, it is not functional when opening
Web panel.
0 - The panel will have its
own refresh, i.e. the
PmaPanel.Refresh method will be called.
The following entries are relevant only
when opening in a new window (i.e. with setting
"target:_blank;"):
modal:nn; - Specifies whether the window will be modal.
0 (default) - The window will not be modal.
1 - The window will be modal.
dependent:nn; - Specifies whether the window will be dependend on the application main window.
0 - The window will be independent on the application main window.
1 (default) - The window will be dependent on the application main window and will always be on top of the application.
caption:nn; - Specifies whether the window has the window title bar or not (i.e. the blue stripe on up).
0 - The window will have
no title bar. For now, it is not functional when opening
Web panel.
1 (default) - The window will have the title bar.
ontop:nn; - Specifies whether the window will be "Always on top".
0 (default) - The window will not be "Always on top".
1 - The window
will be "Always on top". For now, it is not functional when opening
Web panel.
state:xx; - Specifies the initial state of the window.
normal (default) - The window will be displayed normally (neither maximalized nor minimalized).
max - The window will be
maximalized. For now, it is not functional when opening
Web panel.
pos:xx; - Specifies the initial position of the window in normal state.
This position is just recommended. If the window size does not fit into the screen, then the position is shifted so the biggest possible portion of the window is visible.
top,center (default) - The window will be displayed in the center of the active application window (of the workspace).
top,x,y - The window will have the left upper corner in coordinates x and y (in pixels) relative to the active application window (of the workspace).
frame,center - The window will be displayed in the center of the window from which the new window was opened.
screen,x,y - The window will have the
left upper corner in coordinates x and y (in pixels) in
Windows absolute grid system. This option is not functional on the Web. It is used for positioning in main windows of the application (
PmaWorkspace or
PmaPanel) to individual displays. Other application windows are then usually positioned relatively to these main windows.
size:xx; - Specifies the initial size of the window in normal state.
content (default) - The window will be sized to fit the whole opened panel (i.e. no scrollbars are created).
Width and height of the panel is entered
in the graphics editor in the
PmgRoot object on the "
Panel" tab.
The same function as the
content value has the old (but still functional) value
panel.
dx,dy - The window size will be defined by the dx and dy values (in pixels). These values define the outer window size (i.e. including the borders and window title bar).
fixed:xx,yy,..; - It allows to disable the change of state, position or panel size. It is defined as a list of prohibitions separated by "comma" (
,). For now, it is not functional when opening
Web panel. The default value is: Everything is enabled.
state - Disables to change the window state (normal / maximized / minimized).
pos - Disables to change the position of the window in normal state.
size - Disables to change the window size in normal state.
size2 - Disables changing window size in normal state - the window size cannot be greater than the size of corresponding panel.
sParams
(
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;".
These data usually parametrize or filter the content of the corresponding viewed object and are depending on the opened object type.
PmaPanel: It allows to set the value
of parameters of the
PmgRoot object.
This parameter is then accessible in configurators of the panel by means of the
Macro expression $.par and in the script by the
GetPar method.
Each parameter here consists of an identifier (name) and a value.
Syntax:
"pars:{name1:value1;name2:value2; ...}".
See also:
Parameters of the Pmg object.
The static default values of the
sParams parameters can be set in the "
PmaPanel > Panel > sViewPars default value" configurator. In this case the static default setting of the object is combined with the entries provided dynamically.
If the same information is present on both places, then the dynamical information provided at viewer opening is preferred by the system.
PmaReport: It allows to set the value of the report parameters. These parameters are then accessible in the
pEvent.Pars parameter of the
onReportRequest event.
Each parameter consists of an identifier and a value.
Syntax:
"pars:{name1:value1;name2:value2; ...}".
Static default values of the
sViewPars parameters can be set in the "
PmaReport > Report > sViewPars default value" configurator. In this case the static default setting of the object is combined with the entries provided dynamically. If the same information is present on both places, then the dynamical information provided at viewer opening is preferred by the system.
PmaWebDir:
"file:xx;" = The file with the extension (e.g.
file:MyPage.htm), to be displayed. This file must be placed in the folder offered to the Web by
PmaWebDir object (see the "
Folder with files" configurator).
If the file is located in subfolder, then the
file parameter must be entered in the form of "subfolder/file".
If the
file parameter is not specified, then the
default.htm file will be opened and if such file does not exist, then a dynamically created HTML page with file list is opened.
"/#glob/webbrowser": It allows to set the address of the HTML page to be displayed. Syntax: "url:https://www.promotic.eu;".
The address must be defined in full syntax including the protocol: (http://, https:// or file://).
"/#glob/form": Not used.
"/#glob/infosystem": Not used.
oExtra
(
Object) 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).
The object is created by the
Pm.CreatePmMap method.
Example of creating, filling and using the
oExtra object:
List of properties that can be created in the object:
oExtra.Arguments (optional) - (
Variant) Value passed to the viewer that is being opened. This value is then available:
- in the oExtra.onOpen event (see further).
It can be a simple value (
Integer,
String, ...), array or object of the
PmArray or
PmMap type (it is not recommended to transfer objects of other types here).
Entering this value is often important, for example, when opening modal window in order to edit data.
The
Arguments property is then used as input initialization value (the
ReturnValue property as modified output value) - see
How to work with modal windows.
oExtra.onClose (optional) - (object of the
PmAction type) Designer method is defined here
that is called when the panel closes.
The object for this property is created by the
Pm.CreatePmAction method.
This designer method must have two parameters:
-
oSystem: Object of the
PmMap type. Properties of this object
are set by system based on the source of calling. In this case the system sets the following properties:
-
oSystem.CloseReason: (
String) Window closing type identifier.
- When other objects are being viewed, this property is not set.
-
oSystem.ReturnValue: (
Variant) Output value of the viewer.
- When other objects are being viewed, this property is not set.
-
oSystem.ViewObject: (
Object) The
PmForm object that is being viewed.
- When other objects are being viewed, this property is not set.
-
oPrivate: Object of the
PmMap type. Properties of this object
are set by the designer in the
PmAction.PrivateData object. The designer does not have to set any property in this object. If some property is set the result can be for example that a one designer method can be used for multiple purposes based on the value of the property in
PrivateData it can be recognised in this method where was the method called from.
oExtra.onOpen (optional) - (object of the
PmAction type) Designer method is defined here
that is called when the panel opens (i.e. if the panel is being displayed and all graphic objects are constructed).
The object for this property is created by the
Pm.CreatePmAction method.
This designer method must have two parameters:
-
oSystem: Object of the
PmMap type. Properties of this object
are set by system based on the source of calling. In this case the system sets the following properties:
- oSystem.Arguments: (Variant) Input value of the viewer that can be entered in the oExtra.Arguments entry when opening by the OpenView method.
-
oSystem.ViewObject: (
Object) The
PmForm object that is being viewed. When other objects are being viewed, this property is not set.
-
oPrivate: Object of the
PmMap type. Properties of this object
are set by the designer in the
PmAction.PrivateData object. The designer does not have to set any property in this object. If some property is set the result can be for example that a one designer method can be used for multiple purposes based on the value of the property in
PrivateData it can be recognised in this method where was the method called from.
oExtra.onChange (optional) - (object of the
PmAction type) Designer method is defined here
that is called if some item is changed in the viewed object.
The object for this property is created by the
Pm.CreatePmAction method.
This is functional
only if the viewed object is PmForm.
This designer method must have two parameters:
-
oSystem: Object of the
PmMap type. Properties of this object
are set by system based on the source of calling. In this case the system sets the following properties:
-
oSystem.ViewObject: (
Object) The
PmForm object that is being viewed.
-
oSystem.ItemId: (
String)
Pmf object type (this is entered when creating the object by the
PmForm.CreateItem method).
-
oSystem.ChangeType: (
String) Modification type identifier:
- "value": Some object value has been changed.
-
"push": Some item has been pressed. It is functional only for the
PmfButton object.
- oSystem.NewValue: (Variant) Item value after change. This property is set only if ChangeType="value".
- oSystem.OldValue: (Variant) Item value before change. This property is set only if ChangeType="value".
-
oPrivate: Object of the
PmMap type. Properties of this object
are set by the designer in the
PmAction.PrivateData object. The designer does not have to set any property in this object. If some property is set the result can be for example that a one designer method can be used for multiple purposes based on the value of the property in
PrivateData it can be recognised in this method where was the method called from.