Domanda

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.

È stato utile?

Soluzione

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

image.attachBrowserEvent('load', function(){
    alert("Image loaded");
});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top