Imagine an application where a Required Script is configured at the app level, while both a Screen and a Block also have their own Required Scripts. If the Block is included within the Screen, what would be the sequence in which the related JavaScript files are loaded in the browser during the Screen initialization process?
Hello @maged shokry,
The JavaScript files would be loaded in the following sequence during the Screen initialization process:
So, in your scenario:
This follows the OutSystems documented execution order for Required Scripts.
hi @maged shokry , hope you're doing well.Execution of JavaScripts : In runtime, JavaScript in O11 apps is executed in a specific order depending on where it was added. The order is as follows:
Thanks & regards!
Hi @maged shokry
Here is the JS loading sequence
1. Module-level script
2. Block-level script
3. Screen-level script You can checkout this 👉🏼 JS Code.
hi @maged shokry
Screen initialization process :
In OutSystems, the correct loading order is:
1)Application Required Script
2)Block Required Script
3)Screen Required Script
Explanation:
1)Application-level Required Script loads first because it is global and must be available throughout the application.
2)Block-level Required Script loads next because Blocks are rendered as part of the Screen content structure. During screen rendering, included Blocks are processed before the Screen's own initialization logic completes.
3)Screen-level Required Script loads last, after all child elements (including Blocks) have been prepared.
So if a Block is included inside a Screen, the browser initialization sequence becomes:
App - Block - Screen
This is the expected behavior in OutSystems screen initialization.
I hope this helps
Thanks
Attached image and Url for Javasript load sequence .Link - Outsystems Javascript sequence URL Thanks
During Screen initialization, the JavaScript files are loaded in this sequence:
Application-level Required Script
Loaded first because it is global and available for the entire application.
Screen-level Required Script
Loaded next when the Screen starts initializing.
Block-level Required Script
@Lokesh Kumar Yadav ,
you are answering on a week old post that already had several answers, all the others are saying the same as each other and the same as the documentation.
Are you saying all of them AND the documentation is wrong ?
Dorine