ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Control template
  • Overview
  • Programming in WLanguage
  • Passing parameters to a control template
  • Example: File picker created via a control template
  • Getting the default value of the file picker
  • Transmitting the value entered in the control template
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
Handling a Control Template control through programming
Overview
The "Control template" control is used to display an existing control template. Several operations can be performed on the "Control Template" control by programming.
Programming in WLanguage

Passing parameters to a control template

To pass parameters to a control template, we recommend that you:
  1. Create an initialization procedure in the control template.
  2. Call this procedure in the window that contains the "Control Template" control.
Example:
// -- Initialization code of Window1
// TPLC_MyControlTemplate is a control of Window1
// that is linked to a control template
// This control template contains a procedure Init()
TPLC_MyControlTemplate.Init(Param1, Param2)
Example: File picker created via a control template

Getting the default value of the file picker

To retrieve in the control template the default value of the file picker:
  1. In the initialization of the host window for example, initialize the value of the control template:
    TPLC_ControlTemplate1 = "C:\temp"
  2. In the "Set the Value property" event of the control template, retrieve the value and assign it to the Edit control of the file picker:
    EDT_DirEdit = MySelf.Value

Transmitting the value entered in the control template

To transmit the value entered by the user to the host window:
  1. In the "Get the Value property" event of the control template, enter:
    MySelf = EDT_DirEdit.Value
  2. In the host window, all you have to do is retrieve the value of the Control Template control:
    Info(TPLC_ControlTemplate1.Value)
See also
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/31/2022

Send a report | Local help