Titanium Community Questions & Answer Archive

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

leftImage not showing when loaded from XML

I'm loading all of my data in from XML for my rows. I'm confident all of the elements are loading correctly, but the leftImage just refuses to load. If I force the line to be a local path, that works, but of course the image is the same across each row and that won't work.

If this is a noob question, pardon me. I'm just pulling my hair out and not finding much help.


var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function()
{
    var data = [];  
    var doc = this.responseXML.documentElement;
    var nodes = doc.getElementsByTagName("nodes");
    var shopname = nodes.item(0).getElementsByTagName("node");
    for (var i=0;i<shopname.length;i++) {
        var row = Ti.UI.createTableViewRow();
        row.hasChild = true;
        row.title = shopname.item(i).getAttribute("id");
            //Ti.API.info(shopname.item(i).getAttribute("url"));
        row.backgroundImage = "../images/tableview/off_1.png";
        row.leftImage = shopname.item(i).getAttribute("url");
        //row.color = "red";
        data[i]=row;
    };
— asked July 6th 2010 by Chris Dotson
  • array
  • leftimage
  • url
  • xhr
  • xml
0 Comments

1 Answer

  • I've spent the morning trying other ways to do this. If I make an imageView just below this and load the images, they appear in their respective rows. So it seems like they are no loading with the code above, but if I load them after the fact they show up just fine.

    Any thoughts? Anyone?

    — answered July 7th 2010 by Chris Dotson
    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.