Event Handlers on Page Loaded

I'm a recent convert to OutSystems Platform and I was looking for a way of executing another Action independant of the Preparation Action after a web page had completely loaded similar to the JS function OnLoaded. Is there a concept of Event Handling so that I can execute another Action for this and other Event Types. In this case I want to wait until the Web Page has completely loaded before I do my other action?
Hi Andrew,

There is no "OnLoaded" System Event in Outsystems Platform, but if you wish to execute an action after the page is completed loaded, you can add a script to your page to trigger a hidden link that executes an Action (see the example at the end). You can try to use the Event System component too, maybe it can help you achieve what you need.

"<script type="text/javascript">
    window.onload = function () {
           $('#" + YourLinkButton.Id + "').click(); 
    }
</script>"

Just wanted to know what I am doing wrong


Hi Johann,

When using quotes inside of quotes you need to use double quotes ("") so outsystems knows you aren't closing the quotes. You can also use ' instead.

Regards,

Marcelo


When using quotation marks inside quotations marks, you need to change the type, between double ( " ) and single ( ' ) marks. Like in the example above. Also, don't forget to give a name to your button or you will not be able to reference it expressions or logic. At last but not least don't forget to change the escape Content property to No when using nested JavaScript in expressions.



If you have picture in page and you want trigger when also picture is loaded, is this working?

In such case I tried to use JS  window.onload, but it seems to fail sometimes.