ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Web-specific functions / Miscellaneous WEBDEV functions
  • JSProperty handles the control aliases
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
JSProperty (Function)
In french: JSPropriété
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 function is an advanced function: a good knowledge of Javascript is required.
Example
// 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"))
// Remark: The Alias property is used
// 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.
Syntax

Retrieving the value of a property for a page element Hide the details

<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 Hide the details

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

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.
Related Examples:
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.
Component: WDJS.DLL
Minimum version required
  • Version 9
Comments
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 Jun. 2021

Last update: 06/22/2023

Send a report | Local help