Promotic

onPageLoad - event of the PmaWebDir object

Description:
The event is triggered before loading the file (pEvent.FilePath).
The event can be used, for example,:
- for the possible change of the keywords (i.e. the changes of HTML/XML document being sent).
- for disabling sending the file to the client.
- for redirecting the file to another file on the disk.
Parameters:
pMe(Object) Reference to the PmaWebDir object where the event rises.
pEvent(Object) Reference to object describing detailed information about the specific event.
pEvent.User - (Object) [for reading] The PmUser object that represents authorized user, who called the request for this page.
pEvent.Params - (String) [for reading] Text string that contains parameters in the URL.
This string has the form, for example "a=13&b=xyz". It means that "a" has the value "13" and "b" has the value "xyz".
It is possible to separate individual values from this string by the Pm.HTTPGetFormValue method.
pEvent.Method - (String) [for reading] Name of the HTTP method by which the parameters were sent:
"POST" - Sending parameters from the HTML form
"GET" - Sending parameters as a part of the required new page
pEvent.FilePath - (String) [for read and write] Relative path to the file that is requested from the Web browser.
The relative path to the file (relative to Folder with files) can be changed to another relative or absolute file path in this event.
pEvent.TypeEnable - (Long) [for read and write] It enables to set the type of sending the page to the client.
The designer can (according to the user setting, password or the computer address) disable the operation.
Setting this parameter is recommended only for special cases. Common security setting is better to be done by standard means of the permissions: WebRead. See also PmaWeb.onNewRequest, PmaObject-Cfg.Methods.
1 (default) - enabling operation.
-1 - required log-on of the user (if the user hasn't been set) or disabling the user (if the user has been set but the name and password are wrong).
-2 - disabling operation for the client unconditionally.
Note:
The event is triggered before loading the requested file. After loading file and changing by keywords, the onPageModify event is triggered.
Access to keywords is done by the Vars method.
Example:
Event replaces the XXtime keyword by request current time. If the word "_(XXtime)_" is contained in the document, then it will be replaced by the value of XXtime keyword (i.e. the current time) upon reading.
JavaScriptVBScriptSelect and copy to clipboard

pMe.Vars("XXtime").Value = Pm.Time;

History:
Pm9.00.20: New pEvent.Method parameter.
Pm9.00.19:
- New pEvent.Params parameter with parameters in the URL.
- The pEvent.FilePath parameter is now for read and write.
PROMOTIC 9.0.21 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.