PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Limitations
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Warning
From version 26, FileLink is kept for backward compatibility. This property is replaced by DataBinding.
The DataBinding property is used to identify and change the binding between a control and:
  • and an item in a data file.
  • and a variable.
  • Versions 15 and later
    and several variables (in this case, each variable can be bound to a different property of the control).
    New in version 15
    and several variables (in this case, each variable can be bound to a different property of the control).
    and several variables (in this case, each variable can be bound to a different property of the control).
Reminder: The binding between a control and an item or variable is usually defined in the window or page editor, in the control description ("Binding" tab). This binding allows you to specify the data file item that will be used by the synchronization functions (ScreenToFile, ScreenToSource, PageToFile, PageToSource, FileToScreen, FileToPage, SourceToScreen, SourceToPage).
Example of multi-file binding:
'Binding' tab of the control description
This property is equivalent to the ControlAlias function.
Versions 26 and later
This property is now available for Supercontrols and control templates.
New in version 26
This property is now available for Supercontrols and control templates.
This property is now available for Supercontrols and control templates.
Example
// Binds the EDT_Edit1 control to the Name item of the Customer data file
EDT_Edit1.DataBinding = "Customer.Name"
// Same but from the Order data file with 1 binding
EDT_Edit2.DataBinding = "Order.CustomerID" + TAB + "Customer.CustomerID:Name"
// Same but from the OrdLine data file with 2 bindings
EDT_Edit3.DataBinding = "OrdLine.OrdID" + TAB + ...
"Order.OrdID:CustomerID" + TAB + "Customer.CustomerID:Name"
// Binds TABLE_Table1 to Array_Month
TABLE_Table1.DataBinding = ":Array_Month"
// Update on the screen
FileToScreen()
// Whenever SourceToScreen is called, the EDT_Current_Allowed control will have:
// - its displayed value updated by the Authorizing property of a class instance,
// - a background color assigned by the value of a global variable
gclContact is cContact
gsColor is int = PastelBlue
EDT_Current_Allowed.DataBinding = ":gclContact.Authorizing" + TAB + ...
"value" + CR + ":gsColor" + TAB + "BackgroundColor"
// Update on the screen
SourceToScreen()
Syntax

Identifying the binding between a control and an item or variable Hide the details

<Current binding> = <Control used>.DataBinding
<Current binding>: Character string
Different types of bindings can be found:
  • No binding: empty string ("")
  • Simple binding to an item of a data file:
    "<Base file>.<Base item>"
  • Complex binding to an item of a data file:
    "<Base file>.<Base item>[ + TAB + <Binding> [+ TAB + <Binding>]]"

    where <Binding> corresponds to:
    <Related file>.<Key>:<Bound item>[<Index>]
  • Binding to a variable:
    ":<prefix><Variable name>"
    or
    ":<Variable name>"
    (the prefix is applied only if the code style is enabled in the project).
<Control used>: Control name
Name of the control with the binding to be identified.

Modifying the binding between a control and an item or variable Hide the details

<Control used>.DataBinding = <New binding>
<Control used>: Control name
Name of the control with the binding to be modified.
<New binding>: Character string
Different types of bindings can be defined:
  • No binding: empty string ("")
  • Simple binding to an item of a data file:
    "<Base file>.<Base item>"
  • Complex binding to an item of a data file:
    "<Base file>.<Base item>[ + TAB + <Binding> [+ TAB + <Binding>]]"

    where <Binding> corresponds to:
    <Related file>.<Key>:<Bound item>[<Index>]
    Remark: the following syntax is also accepted:
    <[Base file>.<Item>[<[Index]>] [: <Binding> [: <Binding>] ]

    where <Binding> = <Bound file>.<Key>:<DispItem> [<[Index]>]
  • Binding to a variable:
    ":<prefix><Variable name>"
    or
    ":<Variable name>"
    The prefix must be specified only if the code style is enabled in the project (no matter whether prefixes are displayed or not).
  • Versions 15 and later
    Bind multiple properties to multiple variables: the character string that describes the binding must have the following format:
    ":" + <Name of variable 1> + TAB + <Name of property 1> + CR + ...
    ":" + <Name of variable 2> + TAB + <Name of property 2> + CR + ...
    ":" + <Name of variable N> + TAB + <Name of property N>
    New in version 15
    Bind multiple properties to multiple variables: the character string that describes the binding must have the following format:
    ":" + <Name of variable 1> + TAB + <Name of property 1> + CR + ...
    ":" + <Name of variable 2> + TAB + <Name of property 2> + CR + ...
    ":" + <Name of variable N> + TAB + <Name of property N>
    Bind multiple properties to multiple variables: the character string that describes the binding must have the following format:
    ":" + <Name of variable 1> + TAB + <Name of property 1> + CR + ...
    ":" + <Name of variable 2> + TAB + <Name of property 2> + CR + ...
    ":" + <Name of variable N> + TAB + <Name of property N>
Remarks

Limitations

The DataBinding property applies only to controls in a window or page.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment