ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Control template
  • Overview
  • Creating a control template
  • Creating a control template from the window editor
  • Creating a control template from the page editor
  • Create a control Template control from the report editor
  • Creating a control template from existing controls
  • Special cases
  • Test a page or window control Template control
  • Using a control template
  • Renaming a control template
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
A control template is a set of controls that can be re-used in several windows or pages.
  • WINDEV and WINDEV Mobile allow you to create control templates that can be used in the windows.
  • WEBDEV allows you to create control templates that can be used in pages.
  • New in SaaS
    WINDEV, WEBDEV and WINDEV Mobile can be used to create control templates for use in reports.
    Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
    For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
A control Template control can be edited and modified, and once modified, these changes can be applied to all windows, pages or reports using this template.
The control templates are used to:
  • group a set of controls for a specific purpose.
  • make fields independent of the window, page or report hosting them.
Furthermore, the control templates are saved in a ".WDT" file that can be easily transferred from one project to another.
Advantage over supercontrols Changes made to field templates can be automatically applied to all windows (or pages) containing the field template.
Advantage over internal windows, pages or reports Control Template controls are directly integrated, visible and editable in the window, page or report. They can be overridden directly in the window, page or report using the control Template control.
Creating a control template
WINDEVWINDEV Mobile

Creating a control template from the window editor

To create a control Template control from the window editor:
  1. From the window editor, create a new control Template control:
    • Click in the quick access buttons.
    • The window for creating a new element appears: click on "Window", then on "Field template". You can:
      • Create a blank template (based or not on the skin template used by the project),
      • Create a blank template based on a skin template other than the one used by the project,
      • If your project is already using the control templates, create a control template based on another control template of the project. In this case, you will have the ability to perform cascading updates of control templates.
  2. The window editor displays a new area inside a green border named "Control template".
  3. Create all the necessary controls. These controls will be included in all the windows or pages that use the control template.
    Note: Control Template controls can be nested. A control template can use another control template.
  4. If necessary:
    • Enter the processes associated with the controls. These processes will be automatically imported into the window or page that uses the control template.
    • Anchor the controls in the template. These anchors will be automatically used in the window or page that uses the control template.
    • Adjust the size of the template to the controls present in the template ("Resize" in the context menu).
  5. Give your template a name ("General" tab of the description window).
    Note: If you use the programming chart, the field template name is prefixed with "MDLC_".
  6. Save your control template (). The control template is available and it can be used in a "Control template" control. The created file is in ".WDT" format.
Limit Style override at template level is not available.
WEBDEV - Server code

Creating a control template from the page editor

To create a control Template control from the page editor:
  1. From the page editor, create a new control Template control:
    • Click in the quick access buttons.
    • The window for creating a new element appears: click on "Page" then on "Field template". You can:
      • Create a blank control template,
      • If your project is already using the control templates, create a control template based on another control template of the project. In this case, you will have the ability to perform cascading updates of control templates.
  2. Create all the necessary controls. These controls will be included in all the windows or pages that use the control template.
    Note: Control Template controls can be nested. A control template can use another control template.
  3. If necessary:
    • Enter the processes associated with the controls. These processes will be automatically imported into the window or page that uses the control template.
    • Anchor the controls in the template. These anchors will be automatically used in the window or page that uses the control template.
    • Adjust the size of the template to the controls present in the template ("Resize" in the context menu).
  4. Give your template a name ("General" tab of the description window).
    Note: If you use the programming chart, the field template name is prefixed with "MDLC_".
  5. Save your control template (). The control template is available and it can be used in a "Control template" control. The created file is in ".WDT" format.
Limit Style override at template level is not available.
New in SaaS

Create a control Template control from the report editor

To create a control Template control from the report editor:
  1. From the report editor, create a new control Template control:
    • Click in the quick access buttons.
  2. In the window for creating a new element, click on "Status" and then on "Template control".
  3. A blank fields template is created in the editor.
  4. Create all the necessary controls. These fields will be present in all reports using the control Template control.
    Note: Control Template controls can be nested. A control Template control can use another control Template control.
  5. If necessary:
    • Enter the processes associated with the controls. These processes are automatically imported into the report using the control Template control.
    • Anchor the controls in the template. These anchors are automatically used in the report using the control Template control.
    • Adjust the size of the template to the controls present in the template ("Resize" in the context menu).
  6. Give your template a name ("General" tab of the description window).
    Note: If you use the programming chart, the field template name is prefixed with "MDLC_".
  7. Save your control template (). The control template is available and it can be used in a "Control template" control. The file created is in ".WDT" format.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.

Creating a control template from existing controls

To create a control template from existing controls:
  1. Select the controls that must be included in the control template.
  2. On the "Modification" tab, in the "Transformations" group, expand "Refactoring and swapping" and select "Create a control template from the selection".
Remarks:
  • You can also select "Refactoring .. Create a control template from the selection" in the context menu of the selection.
  • You have the ability to create a template of a control template, which means a a control template based on another control template.

Special cases

  • The context menus are available in the control templates:
    • If the window includes context menus, the context menus of the control template must have different names.
    • The context menus of the control template are added to the context menus of the window.
    • If there are two identical control templates with context menus in a window, the override of the context menu of the control template applies to both control templates.
  • If several control templates found in a window have the same source, updating a control template triggers the update of all the control templates that use the same source in the window.
Test a page or window control Template control
To run the test of a control template:
  1. Open the control template in the editor.
  2. Click the "Go" button ("Run the window test" or "Run the page test" icon).
Using a control template
To use a control template:
  1. Open the window or the page in which the control template must be included.
  2. Create a control Template control:
    • for a page or window: under the "Creation" pane, in the "Containers" group, click on "Control template".
    • New in SaaS
      for a subreport: in the "Creation" pane, in the "Structure" group, click on "Control Template".
      Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
      For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
  3. Select the template control to be incorporated in the window, page or report.
    Please note The field template is associated once and for all with the "Field template" field. To change the association, you must delete the "Control Template" control and recreate it.
  4. Validate and position the field if necessary.
Remarks:
  • A template created with WINDEV or WINDEV Mobile (for a window) cannot be used in a page or a report.
  • A template created under WEBDEV (in a page) cannot be used in a window or report.
  • New in SaaS
    A control Template control created for a report cannot be used for a window or a page.
    Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
    For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.

Renaming a control template

If a control template is renamed, the link with the elements that use this template is lost.
This link can be re-established using the template list window: under the "Window" pane, in the "Templates" group, scroll down to "Templates" and select "Template list used".
Related Examples:
WW_Auto_Zoom Training (WEBDEV): WW_Auto_Zoom
[ + ] This example offers a control template based on an image that displays an image thumbnail and through a click, enlarges the image without disturbing the page's layout.
Limitatiosn:
- The images cannot be loaded from a database
- The control template cannot be included in a looper
WW_RSS_Stream Training (WEBDEV): WW_RSS_Stream
[ + ] This example explains how to read and display a RSS stream in a WEBDEV page via the RSS type and via the WLanguage functions for handling RSS.
A reusable control template is used to display the RSS data.
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/14/2025

Send a report | Local help