Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

auto update of image

Heya

I'm about to have a first go on UI5 and what I'm trying to do sounds rather simple to me - yet I haven't succeedet yet. Maybe someone of the comunity my be able to point me in the right direction?

My situation: I have a URL that points to my image. The URL stays the same, just the image is constantly repainted. I would like to update this new image in my view.

What I did do is the following:

I created a view and a model. The model contains the URL to the image

var dataObject = {
            "src" : "http://myurl.com/current.jpg",
        };
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(dataObject);
sap.ui.getCore().setModel(oModel);

Then I bound this model to an image:

var myImage = new sap.m.Image("i1");

  myImage.setSrc(oModel.getProperty('/src'));

Then I've added this image to a page and display this page in my app.

var page = new sap.m.Page({
title: "image",
content:  myImage,
});

The result is, that the app shows the very first image but will never update the content.

How would I trigger the repeating update of this image?

Former Member
Not what you were looking for? View more on this topic or Ask a question