ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Options and actions
  • Overview
  • How to?
  • Creating a control from a variable in the "Project explorer" pane
  • Remarks
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
Overview
Data binding is a process that binds variables in memory to:
  • the controls of a window.
  • the controls of a page.
  • a report (data source).
When creating a control (Table, List Box, etc.), the wizard prompts you to bind it to a variable in the project (global variable or variable used in the current window or page).
You can also create a control and bind it to a variable by dragging the variable from the "Project explorer" pane and dropping it onto the editor.
When creating a report, the wizard prompts you to bind it to a variable. For more details, see Reports based on variables.
How to?

Creating a control from a variable in the "Project explorer" pane

To create a control from a variable in the "Project explorer" pane:
  1. Display the "Project explorer" pane if necessary: on the "Home" tab, in the "Environment" group, expand "Panes", select "Panes", and then select "Project explorer".
  2. Click to select in the "Project explorer" pane the element that is currently displayed in the editor. The details of the variables available from the window or page are displayed in the "Project explorer" pane.
  3. Drag the desired variable and drop it onto the current window or page:
    • an edit control will be automatically created for a simple variable, a class member, a structure member or an advanced member.
    • a Table control will be automatically created for an Array variable.
    • an edit control will be created for each simple member of class variables, structure variables or advanced variables. For the members of an advanced type, you need to drag the member and drop it onto the editor separately.

Remarks

  • Variables must be dragged from the "Project explorer" pane.
  • For classes, new controls are bound to a class instance (i.e., a Class variable). To create these controls, you must select the class variable from the variables of the window or page, and not the class from the "Classes" section of the "Project explorer" pane.
  • The "Classes" section in the "Project explorer" pane lists the available class declarations, and not the class instances.
Related Examples:
WD DataBinding Training (WINDEV): WD DataBinding
[ + ] The "WD DataBinding" example explains how to link a control and a WLanguage variable.

This example includes two windows:
- A first window presents a simple link between the controls and a composite variable.
- A second window presents a link between a table control and a WLanguage class as well as the link between the table and a detailed form
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help