| | | | | | | **WINDEV****WEBDEV** AND **WINDEV MOBILE**  
  
---  
  
| | | | | | | | | | | 

  * Overview
  * Control in a window, in a report, or in a static or dynamic page
  * Use in a page
  * Creating an HTML control
  * Creating an HTML control in a window
  * Creating an HTML control in a page
  * Creating an HTML control in a report
  * Window control: Characteristics
  * Options of "General" tab
  * Use conditions
  * Managing local images
  * "Allow the zoom" option
  * Incompatibility between the IE ActiveX (and oAuth2) and the use of .NET assembly
  * Page control: Characteristics
  * Page control: variable width and height
  * Report control: Characteristics
  * Description window and programming

WINDEV WEBDEV WINDEV Mobile Others

  * Handling an HTML control by programming
  * Referring to an element in a WLanguage process
  * HTML control linked to an item
  * Processes associated with the HTML controls
  * Properties associated with the HTML control
  * ExecuteJS (Function)

The HTML control Overview Control in a window, in a report, or in a static or dynamic pageVersions 16 and later  
The HTML controls are now available for the Android applications. The HTML controls are now available for the Windows Phone applications.New in version 16  
The HTML controls are now available for the Android applications. The HTML controls are now available for the Windows Phone applications. The HTML controls are now available for the Android applications. The HTML controls are now available for the Windows Phone applications.Versions 17 and later  
The HTML controls are now available for the iPhone/iPad applications.New in version 17  
The HTML controls are now available for the iPhone/iPad applications. The HTML controls are now available for the iPhone/iPad applications.Versions 18 and later  
The HTML controls are now available for the applications in Windows Store apps mode.New in version 18  
The HTML controls are now available for the applications in Windows Store apps mode. The HTML controls are now available for the applications in Windows Store apps mode.The HTML control can be used: 

  * In a window.   
The HTML control of a window is used to display an HTML page. 
  * In a page.   
The HTML control of a page is used to display or use an HTML code or a JavaScript code. This code can correspond to HTML scripts for example. The HTML control cannot be used to display an HTML page or an HTML site. This control can only be used to display an HTML code. 
  * Versions 18 and later  
In a report.   
The HTML control of a report is used to print an HTML code or the content of a local page. New in version 18  
In a report.   
The HTML control of a report is used to print an HTML code or the content of a local page.  In a report.   
The HTML control of a report is used to print an HTML code or the content of a local page. 

Use in a pageThe HTML control of a page is used to display or use an HTML code or a JavaScript code. This code can correspond to HTML scripts for example. The HTML control cannot be used to display an HTML page or an HTML site. This control can only be used to display an HTML code.An HTML control can be programmed in server code only if the control is defined as being a "Dynamic" control. The HTML control cannot be associated with an item of a data file.**Caution** : 

  * When the control is defined as being a dynamic control, it can only be assigned by programming. 
  * The option "Forbid the execution of Javascript scripts" is checked by default ("General" tab of control description).

If the window displayed in the HTML control contains scripts and if the user clicks active areas in this HTML control (forms, tab, ...), the requested action triggers the opening of default browser and displays the URL of HTML control in order to allow the user to run these scripts.  
To allow the user to navigate inside the HTML control, uncheck "Forbid the execution of JavaScript scripts".Creating an HTML control To create an HTML control:

  1. In the window or page editor, click  (or select "Insert .. Control .. HTML control").
  2. Click the position where the control will be created in the window or page. The control appears in creation mode.

To display the control characteristics, select "Description" from the popup menu of control.Creating an HTML control in a windowTo create an HTML control in a window:

  1. On the "Creation" pane, in the "Other controls" group, click "HTML".
  2. Click the position where the control will be created in the window. The control appears in creation mode.

To display the control characteristics, select "Description" from the popup menu of control.Creating an HTML control in a pageTo create an HTML control in a page:

  1. On the "Creation" pane, in the "Integration" group, click "HTML".
  2. Click the position where the control will be created in the page. The control appears in creation mode.

To display the control characteristics, select "Description" from the popup menu of control.Versions 18 and later  
Creating an HTML control in a reportTo create an HTML control in a report:

  1. On the "Creation" pane, in the "Usual controls" group, click "HTML".
  2. Click the position where the control will be created in the report. The control appears in creation mode.

To display the control characteristics, select "Description" from the popup menu of control.New in version 18  
Creating an HTML control in a reportTo create an HTML control in a report:

  1. On the "Creation" pane, in the "Usual controls" group, click "HTML".
  2. Click the position where the control will be created in the report. The control appears in creation mode.

To display the control characteristics, select "Description" from the popup menu of control.Creating an HTML control in a reportTo create an HTML control in a report:

  1. On the "Creation" pane, in the "Usual controls" group, click "HTML".
  2. Click the position where the control will be created in the report. The control appears in creation mode.

To display the control characteristics, select "Description" from the popup menu of control.Creating an HTML control in a reportTo create an HTML control in a report:

  1. On the "Creation" pane, in the "Text" group, click "HTML".
  2. Click the position where the control will be created in the report. The control appears in creation mode.

To display the control characteristics, select "Description" from the popup menu of control.Note: From version 22, the HTML control in a report corresponds to an HTML Static control. Window control: Characteristics Options of "General" tabThe "General" tab found in the description window of control is used to: 

  * **type HTML code or the address of HTML page to display**.   
Note: If HTML code is typed, this code must necessarily be found between the <HTML> and </HTML> tags.
  * **allow the execution of scripts**. This option is used to allow the execution of scripts called from the HTML code of control.   
This option is ignored: the execution of scripts is always allowed.   
Versions 23 and later  
If this option is checked, you also have the ability to: 
    * run Javascript code in the context of 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, in the HTML code of control, all you have to do is use **WL.Execute** to run a WLanguage procedure. The following syntax must be used:   
WL.Execute(<Name of WLanguage Procedure>, <Parameter>) where: 
      * <Name of WLanguage procedure> corresponds to the name of procedure to run.   
**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. 
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 checked, you also have the ability to: 
    * run Javascript code in the context of 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, in the HTML code of control, all you have to do is use **WL.Execute** to run a WLanguage procedure. The following syntax must be used:   
WL.Execute(<Name of WLanguage Procedure>, <Parameter>) where: 
      * <Name of WLanguage procedure> corresponds to the name of procedure to run.   
**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. 
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 checked, you also have the ability to: 
    * run Javascript code in the context of 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, in the HTML code of control, all you have to do is use **WL.Execute** to run a WLanguage procedure. The following syntax must be used:   
WL.Execute(<Name of WLanguage Procedure>, <Parameter>) where: 
      * <Name of WLanguage procedure> corresponds to the name of procedure to run.   
**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. 
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  

forbid the execution of scripts. This option is used to allow (or forbid) the execution of scripts called from the HTML code of control.   
This option is ignored: the execution of scripts is always allowed.   
Versions 23 and later  
If this option is unchecked, you can: 
    * run Javascript code in the context of 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, in the HTML code of control, all you have to do is use **WL.Execute** to run a WLanguage procedure. The following syntax must be used:   
WL.Execute(<Name of WLanguage Procedure>, <Parameter>) where: 
      * <Name of WLanguage procedure> corresponds to the name of procedure to run.   
**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. 
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: 
    * run Javascript code in the context of 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, in the HTML code of control, all you have to do is use **WL.Execute** to run a WLanguage procedure. The following syntax must be used:   
WL.Execute(<Name of WLanguage Procedure>, <Parameter>) where: 
      * <Name of WLanguage procedure> corresponds to the name of procedure to run.   
**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. 
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: 
    * run Javascript code in the context of 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, in the HTML code of control, all you have to do is use **WL.Execute** to run a WLanguage procedure. The following syntax must be used:   
WL.Execute(<Name of WLanguage Procedure>, <Parameter>) where: 
      * <Name of WLanguage procedure> corresponds to the name of procedure to run.   
**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. 
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  


Use conditions**Caution** : To use an HTML control: 

  * in a WINDEV application, Internet Explorer version 4 or later (version 11 recommended) must be installed on the development computer and on the deployment computer. The HTML control of WINDEV is in Internet Explorer 7 mode.   
To display WEBDEV pages in this control, the WEBDEV pages must be generated in HTML + Edge mode. 
  * 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  
in an iOS 9.0 application (and later), you must respect the security options. By default, the HTML control can only access the sites that use an HTTPS connection complying with the Apple recommendations. 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 wizard for creating an iOS application. See Generating an iOS application for more details. New in version 21  
in an iOS 9.0 application (and later), you must respect the security options. By default, the HTML control can only access the sites that use an HTTPS connection complying with the Apple recommendations. 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 wizard for creating an iOS application. See Generating an iOS application for more details.  in an iOS 9.0 application (and later), you must respect the security options. By default, the HTML control can only access the sites that use an HTTPS connection complying with the Apple recommendations. 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 wizard for creating an iOS application. See Generating an iOS application for more details. 

Versions 23 and later  
Managing local imagesWhen going to version 23, the local images found in an HTML control may not be displayed anymore. Indeed, for security reasons, loading local images found in the "Documents" directory is not allowed. We recommend that you use fTempDir rather than fResourceDir. New in version 23  
Managing local imagesWhen going to version 23, the local images found in an HTML control may not be displayed anymore. Indeed, for security reasons, loading local images found in the "Documents" directory is not allowed. We recommend that you use fTempDir rather than fResourceDir. Managing local imagesWhen going to version 23, the local images found in an HTML control may not be displayed anymore. Indeed, for security reasons, loading local images found in the "Documents" directory is not allowed. We recommend that you use fTempDir rather than fResourceDir. Versions 17 and later  
"Allow the zoom" optionThe option "Allow the zoom" ("GUI" tab in the description window of control) allows the user to use the zoom options in the HTML control. New in version 17  
"Allow the zoom" optionThe option "Allow the zoom" ("GUI" tab in the description window of control) allows the user to use the zoom options in the HTML control. "Allow the zoom" optionThe option "Allow the zoom" ("GUI" tab in the description window of control) allows the user to use the zoom options in the HTML control. "Allow the zoom" optionThe option "Allow the zoom" ("GUI" tab in the control description window): 

  * allows the user to modify the zoom by moving his fingers. 
  * displays the zoom buttons. 

**To play HTML 5 videos in an HTML control** : 

  1. Check "Allow the execution of scripts" ("General" tab in the description window of control). 
  2. Enable the device acceleration on the window. To do so, you must edit the manifest of the application. 
     * In the generation wizard, display 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
     * End the wizard.

Incompatibility between the IE ActiveX (and oAuth2) and the use of .NET assemblyWhen an HTML control is used in WINDEV, this control is using the system "Microsoft Web browser" ActiveX. This ActiveX is also used by WINDEV for all OAuth2 authentications (Facebook, Twitter, Google, etc.) that require a validation for the connection via HTML code.If an HTML control (or an OAuth2 authentication) and a ".Net"assembly are used in the same project, an incompatibility may occur between the .NET layers of Microsoft and the ActiveX.An API can be used to manage this cohabitation. To do so, the following code line must be used in the initialization code of the project or in the initialization code of classes or global procedure if the ".Net" object is initialized in the class or in the set of procedures: // Used to manage the cohabitation between IE ActiveX and .NET  
API("OLE32", "CoInitializeEx", Null, 2)  
Page control: Characteristics Page control: variable width and heightBy default, the dimensions of HTML control are defined in the editor. If the HTML content of control is bigger, the content is truncated.To modify this operating mode, check "Variable width" and "Variable height" ("Details" tab of the description window). In this case, the dimensions of the HTML control will adapt to the content of the control and the controls located beside or below the HTML control it will be moved accordingly.Report control: Characteristics Versions 18 and later  
Description window and programmingIn the description window of control, you have the ability to type a text in the "General" tab of control. This text will be automatically converted to HTML. The HTML control is used to display: 

  * the content of a local HTML file. 
  * the HTML content of an item. 

To initialize the HTML control by programming, it can be assigned with: 

  * an HTML code directly. For example:   
HTM_Code = "**Hello** "  

  * the path of a local HTML file.   
HTM_Code = fExeDir() + "\MyHTMLFile.htm"  


Notes: 

  * The images in PNG and SVG format found in the HTML are not supported. 
  * If the CSS style sheet corresponds to an external file, it is ignored. 
  * All the external files that must be found on Internet are ignored. 
  * The Javascript codes are not run. 

New in version 18  
Description window and programmingIn the description window of control, you have the ability to type a text in the "General" tab of control. This text will be automatically converted to HTML. The HTML control is used to display: 

  * the content of a local HTML file. 
  * the HTML content of an item. 

To initialize the HTML control by programming, it can be assigned with: 

  * an HTML code directly. For example:   
HTM_Code = "**Hello** "  

  * the path of a local HTML file.   
HTM_Code = fExeDir() + "\MyHTMLFile.htm"  


Notes: 

  * The images in PNG and SVG format found in the HTML are not supported. 
  * If the CSS style sheet corresponds to an external file, it is ignored. 
  * All the external files that must be found on Internet are ignored. 
  * The Javascript codes are not run. 

Description window and programmingIn the description window of control, you have the ability to type a text in the "General" tab of control. This text will be automatically converted to HTML. The HTML control is used to display: 

  * the content of a local HTML file. 
  * the HTML content of an item. 

To initialize the HTML control by programming, it can be assigned with: 

  * an HTML code directly. For example:   
HTM_Code = "**Hello** "  

  * the path of a local HTML file.   
HTM_Code = fExeDir() + "\MyHTMLFile.htm"  


Notes: 

  * The images in PNG and SVG format found in the HTML are not supported. 
  * If the CSS style sheet corresponds to an external file, it is ignored. 
  * All the external files that must be found on Internet are ignored. 
  * The Javascript codes are not run. 

Related Examples:  |  |  Unit examples (WINDEV): The HTML control  [ + ] Using an HTML control   
---|---  
  
|  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.   
---|---  
  
|  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.   
---|---  
  
  * Handling an HTML control by programming
  * Referring to an element in a WLanguage process
  * HTML control linked to an item
  * Processes associated with the HTML controls
  * Properties associated with the HTML control
  * ExecuteJS (Function)



Minimum version required

  * Version 9

  
  
| | | | | | | | | | | | Control HTML = Control View PDF  
---  
| | Did you know that the HTML control allows you to view various types of files like JPG, PNG, GIF, PDF and many other types? Well, it is possible to visualize different types of files, just inform the HTML control to open the file via programming code containing the PATH of the file.  
  
==== CONTROL HTML OPEN PDF ====  
  
Você sabia que o controle HTML permite visualizar diversos tipos de arquivos como JPG, PNG, GIF, PDF e muitos outros tipos? Pois bem, é possível SIM visualizar diferentes tipos de arquivos, basta informar para o controle HTML para abrir o arquivo via código de programação contendo o PATH do arquivo.  
  
URL_FILE IS STRING = "c:\temp\pedido.pdf"  
  
or  
  
URL_FILE IS STRING = "http://mysite.com/pedido.pdf"  
  
CONTROL_HTML_PEDIDOS = URL_FILE  
  
OK  
---  
  
| | | | | | | | Video Pesquisa google  
---  
| | https://youtu.be/zN2jRmYPUhA  
  
https://windevdesenvolvimento.blogspot.com/2019/06/dicas-2141-windev-webdev-mobile.html  
  
// BTN_PESQUISA_GOOGLE  
sPESQUISA is string="https://www.google.co.in/search?q="+EDT_Site  
HTM_SITE=sPESQUISA  
  
---  
  
| | | | | | | | Video Html WebDev  
---  
| | https://youtu.be/EWW9_urMBWQ  
---  
  
| | | | | | | | Video Html WINDEV  
---  
| | https://youtu.be/RJHDt5BpOhA  
---  
  
| | | | | | | | Video Html Windev Mobile  
---  
| | https://youtu.be/bKPR1UdsYxU  
---