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:

 

[label]

{object}.InnerHTML

[GIVING {return}]:

 

 

USING [*Html=]{htmlpage}[:

 

 

[*Flags=]{flags}]

 

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:

  1. If the value returned is zero, the ZERO Condition Flag is set. A {return} value of zero indicates that the method executed successfully.

  2. The EOS Condition Flag is always cleared.

  3. The OVER Condition Flag is set if the {return} variable it too small to receive the method result without truncation.

  4. The {flags} are defined as follows. Labels are defined in the plbmeth.inc inclusion file:
     

  5. 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.

     

  6. 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).

  7. After the InnerHtml method has been successfully executed, PLB GUI objects can be added to the PANEL.

  8. 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:

  9.  

    <meta http-equiv='X-UA-Compatible' content='IE=edge' />

     

    This causes the latest version of IE to be used as the browser engine.

     

  10. 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:

  11.  

    1. The 'data-plbevent={eventnames}' must be declared for each HTML object which is to generate an event.

    2.  

      Where:

      {eventnames}
      This is a string of one or more JavaScript event names which must be separated by a whitespace character delimiter. See this URL Link for more information on events:
       

      https://developer.mozilla.org/en-US/docs/Web/Events

       
      The data-plbevent events for the Plbwin, Plbnet, and Plbserve runtimes are limited to blur, change, click, dblclick, focus, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, and mouseup.

       

    3. 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.

    4.  

      Example of EventRegister Method:

       

      HTML object sample with 'data-plbevent' declared:

       

      <button data-plbevent='click' id='testb'>Testing</button>

       

      EventRegister Required:

       

      EVENTREG Panel,$JQueryEvent,HctlEvent, ARG1=JsonData

       

      or

       

      EVENTREG Panel,200,PanelEvent,ARG1=JsonData

       

  12. 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.

  13.  

    HTML object sample with 'data-plbenable' declared:

     

    <button data-plbenable='on' data-plbevent='click' id='testb'>Testing</button>

     

  14. 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.

  15.  

    The HTML object sample with 'data-plbtabid' declared:

     

    <input type='text' data-plbenable='on' data-plbtabid='1' id='myEdit1'>

     

    <input type='text' data-plbenable='on' data-plbtabid='2' id='myEdit2'>

     

    <input type='text' data-plbenable='on' data-plbtabid='3' id='myEdit3'>

     

  16. This method is implemented using the Windows 'IWebBrowser2' interface for the Windows PL/B runtimes.

 

 

See Also: HTMLControl Methods, Panel Methods, Method Syntax



PL/B Language Reference PANEL Methods PrtPreviewAction Method (PANEL)