InnerHTML Method
10.0A, PLBCMP GUI Only
The InnerHTML method sends a HTML page to a PANEL object that does not contain any GUI objects or a HTMLCONTROL object. This method uses the following format:
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A Panel or HTMLCONTROL that is accessed.
return
Optional. A Numeric Variable that indicates the success or failure of the method.
htmlpage
Required. A Character String Variable or literal that contains the HTML page sent to the PANEL or HTMLCONTROL.
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 string is sent to the PANEL or HTMLCONTROL object exactly as provided. |
|
0x01 |
$HTML_HAS_EVENTS |
Enable HTML events for any HTML objects in the InnerHtml {htmlpage} that has the HTML element data-plbevent='eventname' attribute defined. This flag is only valid for the PANEL object, and is always on for the HTMLCONTROL object. This flag is not used when the $HTML_FROM_URL bit is used. |
|
0x02 |
$HTML_FROM_URL |
This bit value allows the {htmlpage} string to be specified as a valid 'url' reference. This bit value can be used in the Plbwin, Plbnet, Plbserve, and Plbwebsrv runtimes. |
|
0x04 |
$HTML_USE_SCROLLBARS |
This bit value allows the vertical and horizontal scrollbars to be created for the PANEL object only when using the Plbwin, Plbnet, and Plbserve runtimes.
When using an HTMLCONTROL object, this bit 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 PANEL or HTMLCONTROL object. This bit value is only supported in the Plbwin, Plbnet, and Plbserve runtimes. |
The InnerHtml method does not send the {htmlpage} data to the PANEL if the PANEL has PLB GUI child objects. In this case, the {return} value is one (1).
After the InnerHtml method has been successfully executed, PLB GUI objects can be added to the PANEL.
When the HTML data is loaded from a URL using the Plbwin, Plbnet, and Plbserve runtimes, the IE browser level support can be with a <meta> tag. This tag should be the first tag after the <head> tag and resemble the following line:
This causes the latest version of IE to be used as the browser engine.
The PANEL or HTMLCONTROL {htmlpage} data string 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 HTMLCONTROL {htmlpage} data string 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. However, the Windows PL/B runtimes do not support any HTML object events as described in Note 8.
HTML object sample with 'data-plbenable' declared:
The HTMLCONTROL {htmlpage} data string 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:
This method is implemented using the Windows 'IWebBrowser2' interface for the Windows PL/B runtimes.
See Also: HTMLControl Methods, Panel Methods, Method Syntax
![]() |