Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

TableView leftImage parameter can't be a URL ?

Hi

I am trying to create a tableView that has a left Image, when I use local image files it works fine.

when I use URLs the image does not display at all on the iPhone simulator but works well on the Android simulator…

what am I doing wrong ?

var RegData = [

{ leftImage:'../images/fonebook/phone_icon.png', title:"Spain", hasChild:true },
{ leftImage:'../images/fonebook/phone_icon.png', title:"United Kingdom", hasChild:true },
{ leftImage:'../images/fonebook/phone_icon.png', title:"United States", hasChild:true },
{ leftImage:'../images/fonebook/phone_icon.png', title:"France", hasChild:true }
];

var TheTable = Titanium.UI.createTableView({
data:RegData
});
win.add(TheTable);
var RegData = [

{ leftImage:'http://devimages.apple.com/assets/elements/icons/32x32/video.png', title:"Spain", hasChild:true },
{ leftImage:'http://devimages.apple.com/assets/elements/icons/32x32/video.png', title:"United Kingdom", hasChild:true },
{ leftImage:'http://devimages.apple.com/assets/elements/icons/32x32/video.png', title:"United States", hasChild:true },
{ leftImage:'http://devimages.apple.com/assets/elements/icons/32x32/video.png', title:"France", hasChild:true }
];

var TheTable = Titanium.UI.createTableView({
data:RegData
});
win.add(TheTable);
— asked December 1st 2010 by Moshe Marciano
  • image
  • iphone
  • leftimage
  • tableview
  • url
0 Comments

4 Answers

  • I don't think it is the same issue. Mine is leftImage which should be supported.

    — answered December 1st 2010 by Moshe Marciano
    permalink
    1 Comment
    • yes it "should" be supported, but it doesn't work… what I am suggesting is that sounds unbelievably similar so you might want to investigate if it is in fact a known bug… I tested the code above and it fails… none of the kitchen sink examples use remote urls for leftImages either.

      — commented December 2nd 2010 by Aaron Saunders
  • Hi Moshe,

    i just ran into the same problem that you describe (thus i can confirm it exists ;) and found a solution for it: if you create your TableViewRows yourself, adding an ImageView object to each row, your self-created "leftImage"s can have remote urls.

    you can find a blogpost about that at http://cssgallery.info/custom-row-for-tableview-in-appcelerator-titanium/ which is mostly correct and was a good starting point for me to dig deeper.

    HTH
    pekue

    — answered June 10th 2011 by Peter Kuehn
    permalink
    0 Comments
  • that solution worked perfectly until i upgraded to the latest mobile SDK (1.7) and now i get the error:

    [WARN] Creating [object TiUITableViewRow] in a different context than the calling function.
    [WARN] (null)->(null) [0]->[object UIModule] is being made in a thread not owned by <KrollContext: 0x6a71000>

    and the image doesn't display.

    anybody run into this?

    — answered October 4th 2011 by Daneel Malgas
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.