Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-16050

MobileWeb: load event on imageView not firing

    Details

    • Story Points:
      1

      Description

      When using Ti.UI.createImageView on MobileWeb, the "load" event never fires. I tried to use "postlayout", but this event fires twice the FIRST time the image is loaded (i.e. is not in the browser cache) and once every subsequent time.

      Using Blob (with it's various means of downloading image data into it) is not supported on MobileWeb, so there seems to be no way of actually knowing when an image is completely downloaded.

      Steps to Reproduce
      1. Create empty project in Studio based on Classic->HTML-based Application
      2. Remove everything between <body> and </body> in Resources/HTML/index.html
      3. Replace everything in app.js with code below
      4. Create folder Resources/comics and download panelA.png from http://www.ontonauts.com/reader_indev/comics/panelA.png
      5. Run the project

      You will see that the "image has loaded" text is never sent to the Javascript console, i.e. the event is never triggered.
      Test Case

      var oxi = {};
       
      (function(){
           
          //require and open top level UI component
          var ApplicationWindow = require('ui/ApplicationWindow');
          var _win = new ApplicationWindow();
          _win.open();
       
          var eventHandler = function(e) {
              switch (e.type) {
                  case 'load':
                      Ti.API.info('image has loaded');
                      break;
              }
          };
       
          var img = Ti.UI.createImageView();
          img.addEventListener('load',eventHandler);
          img.setImage('comics/panelA.png');
          _win.add(img);
      })();
      

        Attachments

          Activity

            People

            • Assignee:
              emerriman Eric Merriman
              Reporter:
              mortenfthomsen Morten F. Thomsen
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-18081
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code