This document explains the order in which events are executed in a Panel for Android and iOS applications, including components, Global Events, and application lifecycle events such as ApplicationPause, ApplicationResume, and Back.
Understanding this sequence helps developers design predictable data flows, avoid redundant server calls, and coordinate communication between nested components.
When a Panel is executed, a specific sequence of client and server events takes place. These events determine how and when UI initialization, data loading, and updates occur.
|
Order
|
Event
|
Context
|
Description
|
|
1
|
ClientStart
|
Client
|
Runs once on the device when the Panel is first opened. Used to initialize variables, UI controls, and access device capabilities.
|
|
2
|
Navigation.Start
|
Client
|
Runs after ClientStart when the navigation style requires it (Slide, Tab, Flip, etc.).
|
|
3
|
Start
|
Server
|
Executes once. Used for data initialization, service calls, or loading fixed information into variables.
|
|
4
|
Refresh
|
Server
|
Runs after Start. Used for dynamic data updates or variable recalculation.
|
| 5 |
Load |
Server |
Runs last, once per record if the grid has a Base Table, once if it has no base table, and not at all if the grid is SDT-based. |
For example: Panel opens → ClientStart → Navigation.Start → Start → Refresh → Load
You can manually trigger a refresh using the Refresh() command from any client event. If the data context has changed, the Refresh and Load events are executed again. Otherwise, no server request occurs.
Note: Use Parm() rules with filters to force reloading.
When a Panel contains components, each component executes its own independent event sequence immediately after the main Panel’s events finish.
Sample:
MainPanel.ClientStart
MainPanel.Start
MainPanel.Refresh
MainPanel.Load
├── ComponentA.ClientStart
│ ├── ComponentA.Start
│ ├── ComponentA.Refresh
│ └── ComponentA.Load
└── ComponentB.ClientStart
├── ComponentB.Start
├── ComponentB.Refresh
└── ComponentB.Load
Global Events allow components to communicate inside a Panel without having direct references to each other. They use the predefined external object GlobalEvents, which works as an event bus within the same screen.
Usage Example:
Event ItemUpdated(&ProductId)
EndEvent
Event &Update.Click
GlobalEvents.ItemUpdated(&ProductId)
EndEvent
Event GlobalEvents.ItemUpdated
Refresh()
EndEvent
When a mobile application transitions between background and foreground, GeneXus executes application lifecycle events that allow you to manage state restoration or data updates.
| Event |
Trigger |
Platform |
Behavior |
| ApplicationPause |
Applications goes to background. |
Android & iOS |
Executes once in the visible Panel. Used to save state, stop timers, or pause animations. |
| ApplicationResume |
Application returns to foreground. |
Android & iOS |
Executes before interaction resumes. Used to refresh or synchronize data. |
| Back |
User navigates back. |
Android & iOS |
Captures hardware button or gesture. If not handled, it performs default navigation. |
Event ApplicationResume
Refresh()
EndEvent
This sample shows a complete execution flow for a Panel with Components and Global Events:
1. The user opens ProductPanel → ClientStart → Navigation.Start → Start → Refresh → Load
2. Two components (ProductInfo and ProductList) execute their full cycles.
3. The user marks a product as favorite in ProductList, triggering GlobalEvents.FavoriteUpdated().
4. ProductInfo listens and executes Refresh → Load.
5. The user switches to another application → ApplicationPause executes.
6. The user returns → ApplicationResume executes → Refresh() updates data.
7. The user presses Back → Event 'Back' executes, controlling navigation.
| Event |
Context |
Frequency |
Purpose |
| ClientStart |
Client |
Once |
Initialize UI and device state. |
| Navigation.Start |
Client |
Once |
Navigation-specific setup. |
| Start |
Server |
Once |
Initialize data and variables. |
| Refresh |
Server |
Multiple |
Reload data dynamically. |
| Load |
Server |
Per record |
Populate Grids. |
| GlobalEvents |
Client |
On demand |
Communicate between Components. |
| ApplicationPause |
Client |
On demand |
Save UI state. |
| ApplicationResume |
Client |
On demand |
Restore or sync data. |
| Back |
Client |
On demand |
Handle navigation or exit. |
- Use ClientStart event for visual setup and device logic.
- Use Start and Refresh events for data loading and filtering.
- Use Parm() rule to force refresh when filter variables change.
- Handle ApplicationPause and ApplicationResume events for continuity.
- Use GlobalEvents to synchronize components.
- Use Components designed to be idempotent (safe to reload).
Native Mobile Applications Events
Server-side Events in Native Mobile Applications
Refresh event
Load event