PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • Control in a window, in a report, or in a static or dynamic page
  • Creating an HTML control
  • Creating an HTML control in a window
  • Creating an HTML control in a report
  • Window control: Characteristics
  • Options of the "General" tab
  • Conditions for using the ActiveX mode
  • Managing local images
  • "Enable zoom" ("UI" tab in the control description window)
  • Report control: Characteristics
  • Description window and programming
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview

Control in a window, in a report, or in a static or dynamic page

Versions 16 and later
Android The HTML controls are now available for the Android applications.
New in version 16
Android The HTML controls are now available for the Android applications.
Android The HTML controls are now available for the Android applications.
Versions 17 and later
iPhone/iPad HTML controls are now available for iPhone/iPad applications.
New in version 17
iPhone/iPad HTML controls are now available for iPhone/iPad applications.
iPhone/iPad HTML controls are now available for iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App HTML controls are now available for applications in Windows Store apps mode.
New in version 18
Universal Windows 10 App HTML controls are now available for applications in Windows Store apps mode.
Universal Windows 10 App HTML controls are now available for applications in Windows Store apps mode.
The HTML control can be used:
Creating an HTML control
AndroidiPhone/iPadUniversal Windows 10 App

Creating an HTML control in a window

Versions 26 and later
In a window, the HTML control corresponds to the HTML Display control.
New in version 26
In a window, the HTML control corresponds to the HTML Display control.
In a window, the HTML control corresponds to the HTML Display control.
To create an HTML Display control in a window:
  1. On the "Creation" pane, in the "Other controls" group, expand "HTML" and select "HTML Display".
  2. Click at the desired location to create the control. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu.
AndroidiPhone/iPadUniversal Windows 10 App
Window control: Characteristics

Options of the "General" tab

The "General" tab in the description window of control is used to:
  • type HTML code or the address of HTML page to display.
    Remark: Any HTML code entered must be between the <HTML> and </HTML> tags.
  • AndroidiPhone/iPad forbid the execution of scripts. This option is used to allow (or prevent) the execution of scripts called from the HTML code of the control.
    iPhone/iPad This option is ignored: the execution of scripts is always allowed.
    Versions 23 and later
    If this option is unchecked, you can:
    • execute JavaScript code in the context of the web page displayed by the HTML control. To do so, use ExecuteJS.
    • allow the execution of WLanguage procedures from the JavaScript code via the option "Allow the WLanguage call from the HTML code (JavaScript WL.Execute function)".
      If this option is selected, simply use WL.Execute in the HTML code of the control to execute a WLanguage procedure. The following syntax must be used:
      WL.Execute(<WLanguage procedure name>, <Parameter>)
      where:
      • <WLanguage procedure name> corresponds to the name of the procedure to be executed.
        CAUTION: The WLanguage procedure must necessarily expect a single parameter.
      • <Parameter> corresponds to a character string that will be passed to the procedure. This parameter is mandatory.
      If this option is selected, simply use WL.Execute in the HTML code of the control to execute a WLanguage procedure. The following syntax must be used:
      WL.Execute(<WLanguage procedure name>, <Parameter>)
      where:
      • <WLanguage procedure name> corresponds to the name of the procedure to be executed.
        CAUTION: The WLanguage procedure must necessarily expect a single parameter.
      • <Parameter N> corresponds to the different parameters to be passed to the procedure:
        • Number of parameters:
          • iPhone/iPad between 0 and N.
          • Android between 0 and 10.
        • Type of parameters:
          • iPhone/iPad The parameters of the WLanguage procedure will be passed according to their type: boolean, string, number, null.
          • Android The parameters of the WLanguage procedure will always be passed as strings.
      Example:
      • WLanguage procedure
        PROCEDURE ProcFromJS(t)
        ToastDisplay("Called from JS: " + t)
      • Code of HTML control:
        s is string = [
        <html>
        <head>
        <title> A simple example
        </title>
        <script>
        function myFunction()
        {
        WL.Execute("ProcFromJS","titaa");
        }
        </script>
        </head>
        <body>
        <h1> This is an HTML page </h1>
        <p id="demo">A paragraph</p>
        <button type="button" onclick="myFunction()">Try</button>
        </body>
        </html>
        ]
        HTM_NoName1 = s
    New in version 23
    If this option is unchecked, you can:
    • execute JavaScript code in the context of the web page displayed by the HTML control. To do so, use ExecuteJS.
    • allow the execution of WLanguage procedures from the JavaScript code via the option "Allow the WLanguage call from the HTML code (JavaScript WL.Execute function)".
      If this option is selected, simply use WL.Execute in the HTML code of the control to execute a WLanguage procedure. The following syntax must be used:
      WL.Execute(<WLanguage procedure name>, <Parameter>)
      where:
      • <WLanguage procedure name> corresponds to the name of the procedure to be executed.
        CAUTION: The WLanguage procedure must necessarily expect a single parameter.
      • <Parameter> corresponds to a character string that will be passed to the procedure. This parameter is mandatory.
      If this option is selected, simply use WL.Execute in the HTML code of the control to execute a WLanguage procedure. The following syntax must be used:
      WL.Execute(<WLanguage procedure name>, <Parameter>)
      where:
      • <WLanguage procedure name> corresponds to the name of the procedure to be executed.
        CAUTION: The WLanguage procedure must necessarily expect a single parameter.
      • <Parameter N> corresponds to the different parameters to be passed to the procedure:
        • Number of parameters:
          • iPhone/iPad between 0 and N.
          • Android between 0 and 10.
        • Type of parameters:
          • iPhone/iPad The parameters of the WLanguage procedure will be passed according to their type: boolean, string, number, null.
          • Android The parameters of the WLanguage procedure will always be passed as strings.
      Example:
      • WLanguage procedure
        PROCEDURE ProcFromJS(t)
        ToastDisplay("Called from JS: " + t)
      • Code of HTML control:
        s is string = [
        <html>
        <head>
        <title> A simple example
        </title>
        <script>
        function myFunction()
        {
        WL.Execute("ProcFromJS","titaa");
        }
        </script>
        </head>
        <body>
        <h1> This is an HTML page </h1>
        <p id="demo">A paragraph</p>
        <button type="button" onclick="myFunction()">Try</button>
        </body>
        </html>
        ]
        HTM_NoName1 = s
    If this option is unchecked, you can:
    • execute JavaScript code in the context of the web page displayed by the HTML control. To do so, use ExecuteJS.
    • allow the execution of WLanguage procedures from the JavaScript code via the option "Allow the WLanguage call from the HTML code (JavaScript WL.Execute function)".
      If this option is selected, simply use WL.Execute in the HTML code of the control to execute a WLanguage procedure. The following syntax must be used:
      WL.Execute(<WLanguage procedure name>, <Parameter>)
      where:
      • <WLanguage procedure name> corresponds to the name of the procedure to be executed.
        CAUTION: The WLanguage procedure must necessarily expect a single parameter.
      • <Parameter> corresponds to a character string that will be passed to the procedure. This parameter is mandatory.
      If this option is selected, simply use WL.Execute in the HTML code of the control to execute a WLanguage procedure. The following syntax must be used:
      WL.Execute(<WLanguage procedure name>, <Parameter>)
      where:
      • <WLanguage procedure name> corresponds to the name of the procedure to be executed.
        CAUTION: The WLanguage procedure must necessarily expect a single parameter.
      • <Parameter N> corresponds to the different parameters to be passed to the procedure:
        • Number of parameters:
          • iPhone/iPad between 0 and N.
          • Android between 0 and 10.
        • Type of parameters:
          • iPhone/iPad The parameters of the WLanguage procedure will be passed according to their type: boolean, string, number, null.
          • Android The parameters of the WLanguage procedure will always be passed as strings.
      Example:
      • WLanguage procedure
        PROCEDURE ProcFromJS(t)
        ToastDisplay("Called from JS: " + t)
      • Code of HTML control:
        s is string = [
        <html>
        <head>
        <title> A simple example
        </title>
        <script>
        function myFunction()
        {
        WL.Execute("ProcFromJS","titaa");
        }
        </script>
        </head>
        <body>
        <h1> This is an HTML page </h1>
        <p id="demo">A paragraph</p>
        <button type="button" onclick="myFunction()">Try</button>
        </body>
        </html>
        ]
        HTM_NoName1 = s

Conditions for using the ActiveX mode

Caution: To use an HTML Display control:
  • AndroidiPhone/iPadUniversal Windows 10 App in an application in simulator mode, Internet Explorer 4 or later (version 11 recommended) must be installed on the development computer.
  • Versions 21 and later
    iPhone/iPad in an iOS 9.0 application (and later), you must respect the security options. By default, the HTML Display control can only access sites that use an HTTPS connection in compliance with Apple's guidelines. To access other sites (HTTP for example), you must either provide the list of corresponding domains, or disable the security for all the domains. These operations are performed in the iOS application creation wizard. See Generating an iOS application for more details.
    New in version 21
    iPhone/iPad in an iOS 9.0 application (and later), you must respect the security options. By default, the HTML Display control can only access sites that use an HTTPS connection in compliance with Apple's guidelines. To access other sites (HTTP for example), you must either provide the list of corresponding domains, or disable the security for all the domains. These operations are performed in the iOS application creation wizard. See Generating an iOS application for more details.
    iPhone/iPad in an iOS 9.0 application (and later), you must respect the security options. By default, the HTML Display control can only access sites that use an HTTPS connection in compliance with Apple's guidelines. To access other sites (HTTP for example), you must either provide the list of corresponding domains, or disable the security for all the domains. These operations are performed in the iOS application creation wizard. See Generating an iOS application for more details.
Versions 23 and later
iPhone/iPad

Managing local images

When switching to version 23, local images in an HTML control may no longer be displayed. Indeed, for security reasons, loading local images located in the "Documents" directory is not allowed. It is recommended to use fTempDir rather than fResourceDir.
New in version 23
iPhone/iPad

Managing local images

When switching to version 23, local images in an HTML control may no longer be displayed. Indeed, for security reasons, loading local images located in the "Documents" directory is not allowed. It is recommended to use fTempDir rather than fResourceDir.
iPhone/iPad

Managing local images

When switching to version 23, local images in an HTML control may no longer be displayed. Indeed, for security reasons, loading local images located in the "Documents" directory is not allowed. It is recommended to use fTempDir rather than fResourceDir.
AndroidiPhone/iPad

"Enable zoom" ("UI" tab in the control description window)

The "Enable zoom" option:
  • allows the user to pinch zoom.
  • Android displays the zoom buttons.
Android To play HTML 5 videos in an HTML Display control:
  1. Check "Allow execution of scripts" ("General" tab in the control description window).
  2. Enable the device acceleration on the window. To do so, you must edit the manifest of the application.
    • In the generation wizard, go to the "Configuration" step.
    • Click "Advanced configuration".
    • Click "Edit the manifest".
    • Expand the "application" node.
    • Select the "activity" node corresponding to the window containing the HTML control.
    • Add an attribute to this node while specifying "android:hardwareAccelerated" as name and "true" as value.
    • Validate the modifications
    • Finish the wizard.
Related Examples:
The HTML control Unit examples (WINDEV): The HTML control
[ + ] Using an HTML control
HTMLClass property Unit examples (WEBDEV): HTMLClass property
[ + ] The property ..HTMLClass allows you to read and update the control's HTML attribute "class".
This property lets you select the CSS Style applied on the control.
WM HTML Dialog Cross-platform examples (WINDEV Mobile): WM HTML Dialog
[ + ] This example explains how to dialog with an HTML control.
It is using the WLanguage "ExecuteJS" function and the Javascript "WL.Execute" function.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment