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 / WLanguage / Funciones WLanguage / Funciones específicas de la Web / Funciones varias de WEBDEV
  • JSProperty handles the control aliases
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Allows you to handle specific features on the objects found in the current page. Allows you to:
  • read the JavaScript property of an object found in the current page
  • assign a value to the JavaScript property of an object found in the current page.
This is an advanced function, requiring a good knowledge of Javascript.
Ejemplo
// If EDT_Edit1 is an Edit control of the page
// the following statement displays the content of edit control
Info(JSProperty("_PAGE_." + EDT_Edit1.Alias, "value"))
// Note: We use the Alias property 
// to handle the name of the generated control in the HTML page
// Fill the numeric edit controls named EDIT1, EDIT2 and EDIT3 
// with the "test" value
i is int
FOR i = 1 TO 3
	JSProperty("_PAGE_.EDIT" + i, "value") = "test"
END
// CAUTION:
// For this example, clear the "Compress the control names (Alias)" option.
// This option is found: 
// - in the advanced options of the page 
// ("Advanced" tab of the page description, 
// "Custom optimization of HTML code" option)
// - in the advanced options of the project ("Advanced" tab, "Advanced" button). 
// This allows you to keep the names of the generated controls 
// in the HTML pages as they have been defined in the editor.
// You will notice that the names of controls are always generated in uppercase.
Sintaxis

Retrieving the value of a property for a page element Ocultar los detalles

<Result> = JSProperty(<Full element name> , <Property>)
<Result>: Character string or integer
Value of property for the element used.
<Full element name>: Character string
"JavaScript" name of element to use. In most cases, this name starts with "document.". You must use the aliases of controls. For more details, see Remarks.
<Property>: Character string
Property of the element to use.

Modifying a property of a page element Ocultar los detalles

JSProperty(<Full element name>, <Property>) = <New value>
<Full element name>: Character string
"JavaScript" name of element to use. In most cases, this name starts with "document.". You must use the aliases of controls. For more details, see Remarks.
<Property>: Character string
Property of element to modify.
<New value>: Character string or integer
Value of property for the element to modify.
Observaciones

JSProperty handles the control aliases

To build the name of element name, you must know the control alias. This alias corresponds to the control name in the HTML page. To find out this alias:
  • in the code editor, press Shift + F11.
  • use the Alias property.
Componente: WDJS.DLL
Versión mínima requerida
  • Versión 9
Comentarios
exemplo jsproperty
https://windevdesenvolvimento.blogspot.com/2021/05/dicas-3343-windev-webdev-mobile.html
https://youtu.be/xfi-BCjwCSw
// Codigo completo no blog
// exemplo jsproperty
// global decalration of page_historico_Edicao_elimina (server)
gscampos is string=glo_campos_form(MyPage..Name)
//------------------------------------
// Load Page_Pagina_Normal (onload browser event)
//FOR EACH STRING sResultado IN gsCampos SEPARATED BY CR
// JSProperty(sResultado,"autocomplete") ="off"
//END
FOR EACH STRING sResultado IN gscampos SEPARATED BY CR
Info(sResultado)
JSProperty(sResultado,"autocomplete")="off"
END
amarildo
16 06 2021

Última modificación: 28/03/2025

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