Question

I'm wondering how to attach onload event for SAPUI5 image

var image = new sap.ui.commons.Image({id: "cImage"})

I know that there is a way using native js or jquery onload event to do it, but my question is how can I do this using SAPUI5 events like attachPress for clicking for example.

Was it helpful?

Solution

After searching I found a method for ui5 controls called 'attachBrowserEvent' which can handle any browser event:

image.attachBrowserEvent('load', function(){
    alert("Image loaded");
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top