Not able to call screen action on document ready event

For outsystem web application.

I just want to call a screen action on screen load or document load on render the screen.

But I didn't find any event in the web screen page for this.

Only Preparation is an action but that is not useful for me because that time the page is not loaded.

How I can set my default values in the page on load or call the screen action.

Even when I tried to write in javascript mentioned in the property of screen like below

$(document).ready(function(){
  
$actions.onReady()
  
});


But it gives error to all onReady() screen action.

How I can achieve my task in such scenario.

Kindly help me regarding this.

Hi Manish,

For a Traditional Web App, the Preperation is exactly what you want, as that's the time the Screen is prepared (hence the name). Everything you need to get ready for a proper display of the Screen is done at the time the Preperation runs, so there's no need to catch the onReady of the Screen.

For a Reactive Web App, there's no Preperation, but you do have the On Ready Event which allows you to call a Screen Action. However, to set default values, you'd probably want to use the On Initialize Event, as the On Ready runs after the page's Aggregates and Data Actions run.

Manish Kumawat wrote:

For outsystem web application.

I just want to call a screen action on screen load or document load on render the screen.

But I didn't find any event in the web screen page for this.

Only Preparation is an action but that is not useful for me because that time the page is not loaded.

How I can set my default values in the page on load or call the screen action.

Even when I tried to write in javascript mentioned in the property of screen like below

$(document).ready(function(){
  
$actions.onReady()
  
});


But it gives error to all onReady() screen action.

How I can achieve my task in such scenario.

Kindly help me regarding this.

Hi Manish Kumawat,

In this case, i usually use onLoadRow() event to call JavaScript function for setting default value, setting frozen rows or columns, remove some class, addEventListener,... (it works after preparation and before screen loaded)

P/S: My web app use Data Grid Component.

Regards.