Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1156] ImageView in CreateTable

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:55:22.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsiOS
Labelsdefect, imageview, remote, tableview, url
Reporterwallneradam
AssigneeReggie Seagraves
Created2011-04-15T02:45:22.000+0000
Updated2011-04-17T01:55:22.000+0000

Description

Hello,

I have a table with images and labels in its rows. The images are from a remote server. The pictures that are in the viewable area, load correctly, but when I scroll down, the other imageviews have the same picture. Some seconds later they load the correct images, but when I scroll up again, I see the lower images in the top as well and they never refresh again.

I use the latest 1.3.1 from git.

My code:

var thumbRow = function(data) {

var url = getString('filesURL') + '/' + data.fileId + "_1?sessionId=" + urlencode(getString('sessionId'));
var row = Ti.UI.createTableViewRow({
    height: 100,
    _data: data,
    className: 'image',
    hasDetail: data.permission.lc
});

var imgView = Ti.UI.createImageView({
        image: url,
    preventDefaultImage: true,
    width: 128,
    height: 85,
    top: 5,
    left: 5,
    borderWidth: 4,
    borderColor: "#000",
    borderRadius: 5,
    backgroundColor: "#000"
});

var label = Ti.UI.createLabel({
    top: 0,
    left: 138,
    right: 5,
    text: data.fileName
});
row.add(label);

return row;



};

Thanks,
Adam Wallner

Comments

  1. wallneradam 2011-04-15

    It is a separate, cleaner example:

       var w = Ti.UI.createWindow({});
       
       images = [
           'http://t2.gstatic.com/images?q=tbn:BjUSCfLZ6aMORM:http://mariusbardan.files.wordpress.com/2009/10/carbonapple_mono1024.jpg',
           'http://t0.gstatic.com/images?q=tbn:HhYIr-Oz_5sLkM:http://blog.volgyiattila.hu/wp-content/uploads/2009/01/apple-logo1.jpg',
           'http://t3.gstatic.com/images?q=tbn:u18bgKxb_hjznM:http://www.applephone.hu/wp-content/gallery/miki315/apple-marbles.jpg',
           'http://t1.gstatic.com/images?q=tbn:GzVd4vgzFJCrdM:http://muzzak.freeblog.hu/files/apple.jpg',
           'http://t2.gstatic.com/images?q=tbn:-iOGlc8ww3Zx8M:http://www.arukereso.hu/akciostippek/wp-content/uploads/2009/06/apple-iphone.jpg',
           'http://t3.gstatic.com/images?q=tbn:T2pHhXb3a80U1M:http://hirkep.wapzona.hu/2008/07/28/apple_touch.jpg',
           'http://t3.gstatic.com/images?q=tbn:2IfDq8oqmRRJEM:http://mobilisztan.blog.hu/media/image/apple-iphone.jpg',
           'http://t0.gstatic.com/images?q=tbn:CN-Abkg3DWfM4M:http://kepzavar.info/wp-content/uploads/2009/12/apple-iphone.jpg',
           'http://t3.gstatic.com/images?q=tbn:NRHT1TtifhKitM:http://fenyoter.sopron.hu/html/pic/fresh-apple.jpg'
       ];
       
       var table = Ti.UI.createTableView({});
       w.add(table);
       
       for (var i in images) {
           var row = Ti.UI.createTableViewRow({
               height: 150,
               className: 'image'
           });
       
           var imgView = Ti.UI.createImageView({
                   url: images[i],
                   width: 128,
                   height: 100,
               });
           row.add(imgView);
           
           table.appendRow(row);
       }
       w.open();
       

    It works well in 1.3.0, but in 1.3.1 not.

    Thanks,
    Adam Wallner

  2. Jeff Haynie 2011-04-15

    this is a blocker for mondays RC.

  3. Jeff Haynie 2011-04-15

    (from [7df9cc8f63d66cbb90c374ac443f5dd6d80727f3]) [#1161 state:resolved] need to fire image load event each time the image loads [#1156 state:resolved] fixed problems reparenting images in tableview http://github.com/appcelerator/titanium_mobile/commit/7df9cc8f63d66cbb90c374ac443f5dd6d80727f3"> http://github.com/appcelerator/titanium_mobile/commit/7df9cc8f63d66...

  4. Stephen Tramer 2011-04-15

    It was reported that this problem persists. Results of the UI->Views->Table View->Layout 5 test confirm this, but I know for a fact that it was fixed at one point.

  5. Thomas Huelbert 2011-04-15

    valid, has testcase.

    see it in KS by:
    1.buseUI>views>Table View (layout 5)
    2.note the images loaded, scroll down then up again and note the images are different.

    note to me when closing - there is scaling issue with the images. be sure this was addressed or open a new issue.

  6. Blain Hamon 2011-04-15

    Didn't we fix this, again?

  7. Pedro Enrique 2011-04-15

    Built on latest 1.5 and cannot reproduce problem. Also tested the Kitchen Sink sample (Table View Layout 5)
    Issue resolved

JSON Source