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
  • Types of item binding
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Automatically updates the controls in a window or page with:
  • the values of the bound items in the current record (loaded in memory) of the data file described in the data model editor.
  • the values of the bound WLanguage variables.
This operation is performed regardless of the state of the controls (grayed, inactive or invisible).
Remarks:
  • <Window>.FromFile does not read records on the data file. The value of the record loaded in memory is used to update the controls. Therefore, a record must be loaded in memory previously (with <Source>.Read, <Source>.ReadSeek, <Source>.ReadFirst, etc.).
  • This function is global to the window. If it is called in an internal window, the parent window and the other internal windows will benefit from it. The mechanism is identical for the pages.
Example
Customer.ReadSeekFirst(Name, "PAUL")
IF Customer.Found() = True THEN
	WIN_Customer.FromFile(Customer)
END
// Read the record and transfer the items to the controls
Customer.ReadFirst(Name)
WIN_Customer.FromFile(Customer)
Syntax
<Window>.FromFile([<Source>])
<Window>: Window name
Name of the window or page containing the controls to be updated.
Summary: Called when a control gains focus.
<Source>: Optional character string
Name of the source the controls to be updated are bound to. This source can be:
  • The name of a data file. In this case, only the controls bound to the items of the 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.
    Remarks:
    • If the name of the variable is enclosed in quotes, the control will be bound to the specified variable.
    • If the name of the variable is not enclosed in quotes, the control will be bound to the variable data (e.g., a variable containing the name of another variable).
If this name is not specified, all the window or page controls that are bound to a data file described in the data model editor or to a WLanguage variable will be taken into account.
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.

Types of item binding

There are two types of bindings between a control and an item
  • direct binding: In this case, <Window>.FromFile 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: <Window>.FromFile 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.
  • <Window>.FromFile updates the Image controls bound to image memo items.
  • <Window>.FromFile 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.
  • <Window>.FromFile 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 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/14/2024

Send a report | Local help