ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / Binding functions
  • Binding between a control and a WLanguage variable or between a control and a data file item
  • Linking to a field: types of links
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Automatically initializes the controls of a window with:
  • the values of the bound items in the current record (loaded in memory) of the HFSL data file described in the data model editor. This operation is performed regardless of the state of the controls (grayed, inactive or invisible).
  • the values of the bound WLanguage variables. This operation is performed regardless of the state of the controls (grayed, inactive or invisible).
PHP Only the binding to the data file items is supported. Bindings to WLanguage variables are not supported in this version.


Remarks:
Example
// Recherche le client dans le fichier de données
CLIENT.LitRecherchePremier(NOM, "PAUL")
IF CLIENT.Trouve() = True THEN
	// Affiche le client trouvé dans la fenêtre en cours
	CLIENT.VersFenêtre()
END
// Lecture de l'enregistrement et 
// transfert des rubriques vers les champs de la fenêtre FEN_Client
CLIENT.LitPremier(NOM)
CLIENT.VersFenêtre(FEN_Client)
Syntax
<Source>.ToWindow([<Window>])
<Source>: Type corresponding to the specified source
Source to which the items to be updated are bound. For example, this source can be:
  • The name of a data file: only fields linked to a field in this data file are taken into account.
  • The name of a WLanguage variable. In this case, only the controls bound to the WLanguage variable are taken into account. The control will be bound to the variable data (e.g., a variable containing the name of another variable).
<Window>: Window name
Name of the window containing the controls to be updated.
Summary: Called when a control gains focus.
PHP If this parameter is specified, it must correspond to the name of the current page. Otherwise, an error occurs.
Remarks

Binding between a control and a WLanguage variable or between a control and a data file item

The binding between a control and a WLanguage variable or between a control and a data file item can be determined:
  • In the editor, in the control description window ("Binding" tab).
  • Programmatically, with the DataBinding property.

Linking to a field: types of links

There are two types of bindings between a control and an item
  • direct binding: In this case, <Source>.ToWindows transfers the value of the items from the record loaded in memory to the bound control, without reading any values.
  • binding by reading the records in the associated data file.

Miscellaneous

  • Auto-filled Combo Box control bound to an HFSQL data file: <Source>.ToWindows must not be in the "Global declarations" event of the window. The function must be in the "Initialization" event of the window.
  • Space characters in HFSQL items are kept.
  • <Source>.ToWindows updates Image controls with the value of the bound image memo items.
  • <Source>.ToWindows supports the NULL value. If the item content is NULL, an empty string will be displayed in the bound Edit control. To change this display mode, use ControlError.
  • <Source>.ToWindows is not available on views. The values of the items must be assigned to each control.
  • Binding with "Secure Password" items:
    • In an Edit control bound to a Password item, "*****" characters are displayed. If the Edit control is of type "Password", dots are displayed instead.
    • The value of the "Password" item cannot be read again until the user changes the password value.
    • The value of the "Password" item can still be compared to a string (e.g., "" or "1234").
Component: wd300obj.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/22/2024

Send a report | Local help