INNERHTML Property
PLBCMP GUI Only
The INNERHTML property allows rendering of user program HTML into a HTMLCONTROL object. The user HTML data must be properly formatted HTML as expected by normal client browser engines. The property uses the following format:
INNERHTML[={htmlpage}]
Note the following:
INNERHTML may be used in CREATE, SETPROP, or GETPROP statements of an HTMLCONTROL object.
{htmlpage} must be a Character String Variable or literal that contains:
Properly formatted HTML constructs.
Simple Example:
A properly formatted URL that contains a leading '!' character.
Simple Example:
The GETPROP operation retrieves the exact HTML {htmlstring} string rendered by the CREATE and SETPROP operations for the INNERHTML property of a HTMLCONTROL object. If the HTMLCONTROL object has been loaded using the InnerHtml method, the GETPROP of the INNERHTML property returns the HTML loaded by the InnerHTML method.
If the HTMLCONTROL contains user HTML, another SETPROP INNERHTML property operation replaces any previously loaded HTML existing in the HTMLCONTROL.
The 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 be 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 (event number 200) event for a HTMLCONTROL object using the 'InnerHtml' property. In this case, the $JQueryEvent routine receives all of the HTML events declared by the 'data-plbevent' in the 'InnerHtml' property 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 Property:
HTML object sample with 'data-plbevent' declared:
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.
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 are 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 property is implemented using the Windows 'IWebBrowser2' interface for the Windows PL/B runtimes.
This property behaves in the same manner as the InnerHTML method with the default flags settings of zero.
When an HTML page is being rendered into an HTMLCONTROL object, the HTML data can include specialized HTML comments that contain HTML data that is only used by a specific type of runtime ( PLBWIN or Plbwebsrv ). The format of the HTML comments MUST start with '<!-- PLBWIN' or '<!-- PLBPWS' to take affect. Otherwise, the comments ignored.
When a HTML page contains a comment that starts with this comment identifier and a PWS runtime is loading the HTML page, the PWS server removes the comment tags before loading the HTML data into a HTMLCONTROL. If this HTML page is loaded into a HTMLCONTROL by a PLBWIN type type of runtime, the commented lines are ignored and not used.
Example when loading the HTML page into a HTMLCONTROL object:
In this example, the '<!-- PLBWIN' commented <head> lines are only invoked/loaded into an HTMLCONTROL when the PLBWIN runtime is being used. If a PWS server runtime is being used,the '<!-- PLBWIN' comment lines are ignored.
See Also: Object Properties, Object IO Instructions, Object Definitions
![]() |