LOADAT error

  1. last year

    FrujitStudio

    18 Feb 2018 User since 2018
    Edited last year by FrujitStudio

    I would like to display the image from HTTPRequest in ImageView. Because only the image name is given on the server I tried to load the name in the Load () in ImageView and add the missing elements, i.e. the address at the beginning and the type at the end. When I try to open the application I get a LOADAT error. How to fix it?

    The code looks like this:

    var imageName = HTTPClient1.Request.value.list.index[0].weather.index[0].icon;
    var image = "http://openweathermap.org/img/w/" + imageName + ".png";
    ImageView1.url = image;

  2. marco

    18 Feb 2018 Administrator User since 2016

    Hi @FrujitStudio do you have a sample project to send me that is able to reproduce the issue?

  3. FrujitStudio

    18 Feb 2018 User since 2018

    Yes. I have an example project.
    http://www.mediafire.com/file/lcljkiloxikj06h/SampleForFix.creoproject.zip

  4. marco

    18 Feb 2018 Administrator User since 2016

    Hi @FrujitStudio just two minor issues:

    The code to execute is:

    var imageName = HTTPClient1.Request.value.list[0].weather[0].icon;
    var image = "http://openweathermap.org/img/w/" + imageName + ".png";
    ImageView1.url = image;

    (without the index field)

    and you need to execute that code once HTTPClient1.Request completed (in order to have all the fields filled) so you should move that code from ImageView1.load to HTTP1.Request.DidFinish.

  5. FrujitStudio

    19 Feb 2018 User since 2018

    Thanks.

or Sign Up to reply!