AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control de visualización HTML
  • Overview
  • Manipulating HTML Display controls programmatically
  • Displaying information in an HTML Display control
  • Getting the value of an HTML Display control
  • Preventing the user from using a link in a page
  • Associated WLanguage properties
  • Properties specific to HTML Display controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
Manipulating HTML Display controls programmatically
Overview
The HTML Display control displays a web page in an application. Thus, in one line of code, without using an external browser, your WINDEV and WINDEV Mobile applications can display a page from a website.
The HTML Display control can be manipulated directly in the code. To do so, use the variable of the HTML Display control in the code. This variable corresponds to the name of the HTML Display control. The variable type is a character string.
You can also manipulate HTML Display controls in the code using HTML Display control functions.
This help page explains how to programmatically manipulate HTML Display controls.
Manipulating HTML Display controls programmatically

Displaying information in an HTML Display control

To display information in an HTML Display control, simply assign a value
For example:
  • Direct assignment:
    HTM_PageWeb = "http://www.pcsoft.fr"
  • Assignment using a variable:
    HTM_PageWeb = MyPage
You can also use the Value or URL properties.

Getting the value of an HTML Display control

To get the content of an HTML Display control (the user can use the links in the page displayed in the control):
  • Simply assign a value. For example:
    ContenuHTML = HTM_ChampAffichageHTML
  • Use the Value property.
Remark: To obtain the source code of the Web page displayed in the HTML Display control, simply use the Property DisplayedValue on the HTML Display control:
Info(HTM_PageWeb.ValeurAffichée)

Preventing the user from using a link in a page

By default, in the HTML Display control, the user can use the various links in the page displayed in the control.
To limit the use of these links, you can use the "Before loading the HTML page" event.
For the following example, let's assume that the list of authorized sites is contained in a WLanguage array.
PROCEDURE ChangePage(sUrl is string, sDestination is string)
Tabsiteautorisé is array of 2 strings
Tabsiteautorisé[1] = "pcsoft.fr"
Tabsiteautorisé[2] = "google.fr"
let sDomaine = URLExtractPath(sUrl, urlDomain)
IF ArraySeek(Tabsiteautorisé, asLinearFirst, sDomaine) = -1 THEN
		ToastDisplay("Site non autorisé", toastShort, vaMiddle)
		RETURN False
END
RETURN True
This code returns False if the site is not authorized and displays a toast.
Associated WLanguage properties

Properties specific to HTML Display controls

The following properties are used to manage the characteristics of an HTML Display control in the code:
BodyEl Body Property se utiliza para identificar y modificar el cuerpo HTML de un control Display HTML o un editor HTML control.
DocumentLa propiedad Document permite obtener o modificar el documento HTML asociado a un control de visualización HTML o Editor HTML.
SecurityHtmlEl SecurityHtml Property se utiliza para get y cambiar el estado del mecanismo de seguridad de los controles HTML Display y HTML Editor.
URLLa propiedad URL permite:
  • Obtener el Address associated con un control.
  • Cambiar el Address associated por un control.
For a complete list of WLanguage properties that can be used with HTML Display controls, see HTML Display control properties.
Versión mínima requerida
  • Versión 26
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 24/05/2024

Señalar un error o enviar una sugerencia | Ayuda local