PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Executing the "Collapse/Expand" event
  • Calling a global component procedure
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
ExecuteProcess (Function)
In french: ExécuteTraitement
Starts the execution of an event or process programmatically, i.e. without the user having to perform any particular action in the interface. The event/process executed can be:
  • an event of a control (in a window, a page or an report),
  • an event of a menu option,
  • an event of a report block,
  • an event of a window,
  • an event of a page,
  • an event of a report,
  • a process of a procedure.
    Remark: To trigger the execution of a procedure by the main thread of the application, use ExecuteMainThread.
WEBDEV - Server codeWEBDEV - Browser codePHP The event/process executed can be only a processing of a field of a page, a page or an Procedure. When called in server code, only the server code of the element is executed. When called in browser code, both the browser and server codes of the element are executed.
AndroidAndroid Widget Java The event/process executed can only be from a control in a window, from a menu option, from a window or a procedure.
Example
// Runs the click code on a button
ExecuteProcess(BTN_Save, trtClick)
// Runs a local procedure (test) that belongs
// to another opened window/page (menu)
ExecuteProcess(Menu.Test, trtProcédure)
// Runs the ReadFile procedure
// and passes the file name as parameter
ExecuteProcess(ReadFile, trtProcédure, FileName)
Syntax

Executing an event associated with a control Hide the details

ExecuteProcess(<Control used> , <Process>)
<Control used>: Control name
Name of the control (or menu option) associated with the process (or event) to run. For an option in a popup menu, use the following notation: <Name of popup menu>.<Option name>.
<Process>: Integer constant
Event to be executed among the WLanguage events available for controls:
trtActionAction code of Web Component control. This code is available in server code and in browser code.
WINDEVUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
New in version 27
trtAddDiagShape
Code for adding a shape in a Diagram Editor control.
WEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtAddTokenCode for adding a token into a "Text token" edit control.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtAddWidgetCode for adding a widget to a Dashboard control.
Universal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtAfterOpeningDocument"After opening document" code of Word Processing control, Image Editor control, Spreadsheet control or PDF Reader control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppApple WatchJava This constant is not available.
trtBeforeClosingDocument"Before closing document" code of Word Processing control, Image Editor control, Spreadsheet control or PDF Reader control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppApple WatchJava This constant is not available.
trtBeforeCreatingOrganizerApt"Before creating the appointment" code of the Organizer control.
Universal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtBeforeCreatingScheduleApt"Before creating the appointment" code of Scheduler control.
Universal Windows 10 AppApple WatchJava This constant is not available.
trtChange"Whenever modified" code of control.
WEBDEV - Browser code This constant is not available.
New in version 27
trtChangeDiagShape
Code for changing a shape in a Diagram Editor control.
WEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtChangeOrganizerPeriod"Whenever changing period" code of Organizer control.
Universal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtChangePlane"Whenever changing plane" code of a Sliding Banner control.
WINDEVUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtChangePositionMap"Whenever changing position" code of Map control.
AndroidAndroid Widget Java This constant is not available.
trtChangeSchedulePeriod"Whenever changing period" code of Scheduler control.
Universal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtClickClick code of control.
trtClickButtonArrowClick code on the arrow associated with a button.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtClickHTMLLink"Click on a link" code of an HTML Display control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtClickTokenClick code on a token in a "Text token" edit control.
Apple WatchJava This constant is not available.
trtCollapseExpandBranchCollapsed/Expanded code of a node in a TreeView or TreeView Table control.
Caution: This parameter requires a specific syntax. For more details, see remarks.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtCollapseExpandBreakCollapsed/Expanded code of a break in a Looper or Table control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroidApple WatchJava This constant is not available.
trtCollapseExpandDrawerBrowser code run each time the Drawer control is collapsed or expanded.
WINDEVWEBDEV - Server codeUniversal Windows 10 AppAndroidApple WatchJava This constant is not available.
trtComboClosingClosing code of drop-down list.
WEBDEV - Server codeiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtComboOpeningCode for opening the drop-down list of Combo Box control.
WEBDEV - Server codeiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtDelayedPlaneLoad"Delayed plane load" code of a plane.
WINDEVUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
New in version 27
trtDeleteDiagShape
Code for deleting a shape in a Diagram Editor control.
WEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtDeleteOrganizerAptCode for deleting an appointment from an Organizer control.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtDeleteScheduleAptCode for deleting an appointment from a Scheduler control.
Universal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtDeleteTokenCode for deleting a token from a "Text token" edit control.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtDeleteWidgetCode for deleting a widget from a Dashboard control.
Universal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtDoubleClickDouble-click code.
Universal Windows 10 App This constant is not available.
trtEndChange"End of modification" code (Slider and Scrollbar control only).
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtEndInitialization"End of initialization" code (browsing List Box, Table and Combo Box control).
WEBDEV - Browser code This constant is not available.
trtEndLoadingHTMLPage"After loading the HTML page" code of an HTML Display control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtEnterEntry code in the control.
trtEnterInputOrganizerAptEntry code in input for an appointment in an Organizer control.
WEBDEV - Server codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtEnterInputSchedulerAptEntry code in input for an appointment in a Scheduler control.
WEBDEV - Server codeUniversal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtExitExit code of control.
trtInitInitialization code of control.
WEBDEV - Browser code This constant is not available.
trtLineDisplayCode used to display a row (Table control only).
WEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtLineEnterEntry code of a row (Table control only).
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppApple WatchJava This constant is not available.
trtLineExitExit code of row (Table control only).
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtLoadingHTMLResource"Load resources" code of an HTML Editor or HTML Display control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtMenuOptionCode of menu option (main or popup menu).
iPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtModificationColumnFilterCode "Whenever modifying the filter (user input in header)" of a Table Column control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtModificationSpreadsheetCell"Cell modification" code of Spreadsheet control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
New in version 27
trtMoveDiagShape
Code for moving a shape in a Diagram Editor control.
WEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtMoveOrganizerAptCode for moving an appointment in an Organizer control.
Universal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtMoveScheduleAptCode for moving an appointment in a Scheduler control.
Universal Windows 10 AppApple WatchJava This constant is not available.
trtMoveWidget"Moving a widget" code of Dashboard control.
Universal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtOrganizerInputExitAptExit code from input for an appoingment in an Organizer control.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtPullToRefresh"Pull to refresh" code of a Table or Looper control.
WEBDEV - Server codeWEBDEV - Browser codeJava This constant is not available.
trtReadFirstCode for reading the first record (Table control only).
WEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtReadLastCode for reading the last record (Table control only)
WEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtReadNextCode for reading the next record (Table control only).
WEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtReadPreviousCode for reading the previous record (Table control only).
WEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtReassignResourceScheduleAptCode for re-assigning an appointment in a Scheduler control.
Universal Windows 10 AppApple WatchJava This constant is not available.
trtRefreshRibbonCode for refreshing the ribbon of PDF Reader and Word Processing controls.
WEBDEV - Server codeWEBDEV - Browser codeAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
New in version 27
trtResizeDiagShape
Code for resizing a shape in a Diagram Editor control.
WEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtResizeOrganizerAptCode for resizing an appointment in an Organizer control.
WEBDEV - Server codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtResizeScheduleAptCode for resizing an appointment in a Scheduler control.
WEBDEV - Server codeUniversal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtResizeWidget"Resizing a widget" code of Dashboard control.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtRightClickRight-click code (for the TreeView control only).
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtRightClickHTMLLink"Right click on a link" code of an HTML Display control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtScheduleInputExitAptExit code from input for an appoingment in a Scheduler control.
Universal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
New in version 27
trtSelectDiagShape
Code for selecting a shape in a Diagram Editor control.
WEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtSelectionSelection code (Combo Box, List Box and Table control).
WEBDEV - Browser code This constant is not available.
trtSelectOrganizerAptCode for selecting an appointment in an Organizer control.
WEBDEV - Server codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtSelectOrganizerPeriodCode for selecting a period in an Organizer control.
WEBDEV - Server codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtSelectScheduleAptCode for selecting an appointment in a Scheduler control.
WEBDEV - Server codeUniversal Windows 10 AppApple WatchJava This constant is not available.
trtSelectSchedulePeriodCode for selecting a period in a Scheduler control.
WEBDEV - Server codeUniversal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtSliderChange"Whenever modified" code (Slider control only).
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtSpinMinusDecrement code of Spin control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtSpinPlusIncrement code of Spin control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
trtStartLoadingHTMLPage"Before loading the HTML page" code of an HTML Display control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroid Widget Apple WatchJava This constant is not available.
trtValueAssignmentCode for assigning the Value property of Web Component control. This code is available in browser code only.
WINDEVUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtValueRetrievalCode for retrieving the Value property of a Web Component control. This code is available in browser code only.
WINDEVUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.
trtZoomModificationCode for modifying the zoom of a Range Slider control.
WEBDEV - Server codeWEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJava This constant is not available.


Control or block of a report: Event to be executed among the available WLanguage events:
trtPostPrint"Post Print" code of a block.
WEBDEV - Browser codePHP This constant is not available.
trtPrePrint"Pre Print" code of control or block.
WEBDEV - Browser codePHP This constant is not available.
WINDEVReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetIOS WidgetApple WatchMac CatalystJavaUser code (UMC)

Executing a WLanguage event associated with a window Hide the details

ExecuteProcess(<Window used> , <Process>)
<Window used>: Window name
Name of the window with a WLanguage event to be executed.
<Process>: Integer constant
Event to be executed among the WLanguage events available for windows.
trtBeforeClosingWindow"Allow closing" code.
AndroidAndroid Widget IOS WidgetJava This constant is not available.
trtChangeModification code of the window.
trtChangeLayout"Change of layout" code.
Universal Windows 10 AppIOS Widget This constant is not available.
trtClickCode of the button associated with the click in the window.
IOS Widget This constant is not available.
trtClosingClosing code of the window.
trtDoubleClickCode of button associated with the double click in the window.
Universal Windows 10 AppIOS Widget This constant is not available.
trtGetFocusCode of focus gain for the window.
Universal Windows 10 AppIOS Widget This constant is not available.
trtKillFocusCode of focus loss for the window.
Universal Windows 10 AppIOS Widget This constant is not available.
trtOpening or trtInitInitialization code of the window.
trtRequestRefresh"Request for updating the display" code.
IOS Widget This constant is not available.
trtResizeCode for resizing the window.
Universal Windows 10 App This constant is not available.
trtRightClickCode of button associated with the right click in the window.
Universal Windows 10 AppIOS Widget This constant is not available.
trtSystemButton"Before closing with OK/Close button" code.
AndroidAndroid Widget iPhone/iPadIOS WidgetIOS WidgetMac Catalyst This constant is only available for Android and iOS.
WEBDEV - Server codeWEBDEV - Browser codePHPAjax

Executing a WLanguage event associated with a page Hide the details

ExecuteProcess(<Page used> , <Process>)
<Page used>: Page name
Name of the page with a WLanguage event to be executed.
PHP The name of the page must be enclosed in quotes.
<Process>: Integer constant
Event to be executed among the WLanguage events available for pages.
trtChangeLayout
WEBDEV - Server code "Whenever changing layout" code of the page.
trtChangeSlice
WEBDEV - Browser code "Whenever changing blade" code (page in Responsive Web Design mode).
trtClosing
WEBDEV - Server code Closing code of the page.
PHP This constant has no effect.
trtInit
WEBDEV - Server code Initialization code of the page.
trtLoad
WEBDEV - Browser code Load code of the page.
trtOpening
WEBDEV - Server code Opening code of the page.
trtRequestRefresh
WEBDEV - Server code "Request for updating the display" code.
trtReset
WEBDEV - Browser code Code for page reset (initialized form).
trtScroll
WEBDEV - Browser code "Scroll" code of the page.
trtSubmit
WEBDEV - Browser code Code for page submit (form sent).
trtUnload
WEBDEV - Browser code Code for unloading the page.
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)

Executing a WLanguage event associated with a report Hide the details

ExecuteProcess(<Report used> , <Process>)
<Report used>: Report name
Name of the report whose process must be run.
<Process>: Integer constant
event to be executed among the WLanguage events available for reports.
trtClosingClosing code of report.
trtFilterCode for filtering the report data.
trtOpening or trtInitOpening code of report.
trtReadDataCode for reading the report data.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJavaUser code (UMC)PHPAjax

Executing a WLanguage procedure Hide the details

<Result> = ExecuteProcess(<WLanguage procedure> , <Process> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Any
Return value of procedure called. This value is identical to the value obtained if the procedure is run directly.
<WLanguage procedure>: Procedure name
Name of procedure to run.
WEBDEV - Server code The procedure to run corresponds to a server procedure.
<Process>: Integer constant
Procedure to run. This procedure corresponds to:
  • one of the following constants:
    trtProcedureRun the specified procedure according to the execution context (procedure of the window, procedure of the WINDEV/WEBDEV component or procedure of the project).
    trtProjectProcedureRuns the specified procedure. This procedure is a procedure of the project that is hosting the WINDEV/WEBDEV component.
    This parameter can only be used for a WINDEV/WEBDEV component included in another project.
  • a variable of type Procedure Description (usable only to execute a class method). For more details, see Enumerating and handling the objects of a class.
<Parameter 1>: Any optional type
First optional parameter that will be passed to the procedure.
<Parameter N>: Any optional type
Nth optional parameter that will be passed to the procedure.
Remarks
WINDEVUser code (UMC)

Executing the "Collapse/Expand" event


For a TreeView control
The WLanguage "Collapse / Expand" event of a TreeView control expects the following two parameters:
  • <Element path>: Text variable containing the full path of the element currently collapsed or expanded. Simply specify the name of a variable. It will be automatically initialized at runtime.
  • <Collapsed>: Boolean variable, used to find out the action performed by the user (collapse = True, expand = False). Simply specify the name of a variable. It will be automatically initialized at runtime.
To execute this event with ExecuteProcess, you also need to specify these two parameters. In this case, the following syntax must be used:
ExécuteTraitement(<Champ Arbre>, trtEnrouleDérouleBranche, <Chemin de l'élément>, <Enroulé>)
For more details on the "Collapse / Expand" code of a TreeView control, see WLanguage events associated with a TreeView control.
For a TreeView Table control
The WLanguage "Collapse / Expand" event of a TreeView Table control does not expect any parameters.
To execute this event with ExecuteProcess, use the following syntax:
ExécuteTraitement(<Champ Table hiérarchique>, trtEnrouleDérouleBranche)
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax

Calling a global component procedure

ExecuteProcess is used to call a global component procedure. To do so, use the following syntax:
ExécuteTraitement(<Composant>.<Collection de procédures>.<Procédure>, ...
trtProcédure)
Example:
ExecuteProcess("MyComponent.Set_WDExample.MyProcedure", trtProcédure)
In a thread started by a component, ExecuteProcess cannot be used to call a local procedure of a window from the host project.
You must use a global procedure of the host project to call the local procedure of the window.
Business / UI classification: Neutral code
Component: wd270vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Dynamically Execute Class Methods using ExecuteProcess()
Hi

In order to dynamically call class methods use the following syntax.
ClassInst is ClassObject
MethodToCall is string = "ClassMethod"
ReturnVal is string (e.g. if the method returns a string value)

ReturnVal = ExecuteProcess(ClassInst,MethodToCall,Param1,Param2, ...)

PeHoBe
28 Oct. 2021