LoadHTML Method
10.9, PLBCMP GUI Only
The LoadHTML method loads a HTML page from a file into a HTMLCONTROL object. This method uses the following format:
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A HTMLCONTROL that is accessed.
return
Optional. A Numeric Variable that indicates the success or failure of the method.
htmlfile
Required. A Character String Variable or literal that contains the name of a file containing HTML.
flags
Optional. A Numeric Variable or decimal value whose value enforces specialized behaviors.
Flags Affected: EOS, OVER, ZERO
Note the following:
If the value returned is zero, the ZERO Condition Flag is set. A {return} value of zero indicates that the method executed successfully.
The EOS Condition Flag is always cleared.
The OVER Condition Flag is set if the {return} variable it too small to receive the method result without truncation.
The {flags} are defined as follows. Labels are defined in the plbmeth.inc inclusion
file:
|
Value |
Label |
Meaning |
|
0x00 |
|
When all of the {flags} bits are zero, the {htmlpage} data is loaded into HTMLCONTROL and any HTML events.are enabled. |
|
0x04 |
$HTML_USE_SCROLLBARS |
This value allows the vertical and horizontal scrollbars to be created for when using the Plbwin, Plbnet, Plbserve, and Plbwebsrv runtimes. |
|
0x08 |
$HTML_3D_BORDER |
This bit value causes a border to be drawn around the HTMLCONTROL object. This bit value is only supported in the Plbwin, Plbnet, and Plbserve runtimes. |
The {htmlpage} file can include the 'data-plbevent={eventnames}' attribute for a HTML object that is being declared in the HTML page data string. When the 'data-plbevent' is being used, the HTML object events can only occur as follows:
The 'data-plbevent={eventnames}' must be declared for each HTML object which is to generate an event.
Where:
The EVENTREGISTER must be executed to register the $JQueryEvent ( 200 event number ) event for a PANEL or HTMLCONTROL {object} executing the 'InnerHtml' method. In this case, the $JQueryEvent routine receives all of the HTML events declared by the 'data-plbevent' in the 'InnerHtml' data string. The ARG1 contains a JSON object string for the event data. See the EVENTREGISTER for more details on the $JQueryEvent.
Example of EventRegister Method:
HTML object sample with 'data-plbevent' declared:
EventRegister Required:
or
The {htmlpage} file can include the data-plbenable='on' attribute for a HTML object that is being declared in the HTML page data string. When the 'data-plbenable' is being used, the PL/B ENABLED property enables or disables those HTML objects.
HTML object sample with 'data-plbenable' declared:
The {htmlpage} file can include the data-plbtabid={num} attribute for a HTML object that is being declared in the HTML page data string. When the 'data-plbtabid' is being used, the HTML objects will be placed in the PL/B tabbing order as members of the HTMLCONTROL. A data-plbtabid of zero (0) causes the HTML object to be removed from the PL/B tabbing order.
The HTML object sample with 'data-plbtabid' declared:
A return value of zero (0) indicates success. Failures return one of the following values:
|
Value |
Meaning ... |
|
200 |
There is a file name problem. |
|
201 |
Unable to open the specified file. |
|
202 |
Unable to obtain memory to read file. |
|
203 |
Unable to read the specified file. |
See Also: Web Technologies WebView2 Support HTMLCONTROL Method Syntax
![]() |