Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3094] Remote images in custom TableViewRow not loading

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2011-07-08T11:00:11.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterShannon Hicks
AssigneeTony Guntharp
Created2011-06-19T15:06:07.000+0000
Updated2016-03-08T07:48:08.000+0000

Description

When I have a custom TableViewRow with an image in it, and that image has a defined (local) defaultImage, remote images only load for some of the rows some of the time. See line 21 of this example file:
(function() {
	pintley.ui.components.createBeerTrackRow = function(_beerTrack) {
		var row = Titanium.UI.createTableViewRow({layout:'vertical',height:'auto'});
		row.className = 'beertrackrow';
		row.backgroundSelectedColor = '#fff';

		row.addEventListener("click",function(){
			var beerScreen = pintley.clone(pintley.ui.screens.BeerDetailScreenObject);
			beerScreen.data = pintley.combine(beerScreen.data,{beer:_beerTrack.beer});
			beerScreen.backButton = _beerTrack.beer.beerName;
			pintley.ui.screens.MainScreen.newScreen(beerScreen);
		});
		
		var rowView = Titanium.UI.createView({left:0,right:0,height:'auto'});

		var smallGap = 5;
		var largeGap = 10;

		// left image
		var updateImage = Titanium.UI.createImageView({
			defaultImage:'images/loading_60.png', // comment this row out to see the workaround
			image:_beerTrack.beer.thumb,
			top:smallGap,
			left:10,
			width:60,
			height:60
		});
		// iPhone 4 display
		if (Titanium.Platform.displayCaps.dpi == 320) {
			updateImage.image = _beerTrack.beer.thumb2x;
			updateImage.hires = true;
		}
		rowView.add(updateImage);
		
		rowView.add(Ti.UI.createView({height:smallGap,top:65})); // spacer
		
		// content container
		var updateContent = Titanium.UI.createView({
			layout:'vertical',
			left:80,
			right:10,
			top:smallGap,
			height:'auto'
		});
		
		var beerName = Titanium.UI.createLabel({
			color:'#C36466',
			font:{fontSize:15,fontWeight:'bold', fontFamily:'Arial'},
			left:0,
			right:0,
			top:smallGap,
			height:21,
			text:_beerTrack.beer.beerName
		});
		updateContent.add(beerName);
		
		var locationName = Titanium.UI.createLabel({
			color:'#656565',
			font:{fontSize:11,fontWeight:'bold', fontFamily:'Arial'},
			left:0,
			right:0,
			height:'auto',
			text:_beerTrack.locationName
		});
		if (_beerTrack.locationName && _beerTrack.locationName.length > 0) {
			locationName.text = "at " + _beerTrack.locationName;
		}
		updateContent.add(locationName);
		
		var notes = Titanium.UI.createLabel({
			color:'#000',
			font:{fontSize:11,fontFamily:'Arial'},
			left:0,
			right:0,
			height:'auto',
			text:_beerTrack.notes
		});
	
		updateContent.add(notes);
		
		var timeRow = Titanium.UI.createView({
			left:0,
			right:0,
			height:15
		});
		
		var updateTimestamp = Titanium.UI.createLabel({
			left:0,
			right:0,
			bottom:0,
			color:'#656565',
			font:{fontSize:10,fontFamily:'Arial'},
			text:_beerTrack.ago
		});
		timeRow.add(updateTimestamp);
 
		updateContent.add(timeRow);
		
		updateContent.add(Ti.UI.createView({height:pintley.os({android:15, iphone:smallGap})})); // spacer
		
		rowView.add(updateContent);
		
		row.add(rowView);
		
		return row;
	};
})();
The problem started in 1.6.1, and still exists in 1.6.2, 1.7.0 final, and 1.7.1 CI build from 6/18 This seems simple, but since my app is mostly table rows with remote images, this is a blocker for me. There are many other bugs that 1.7.0 is supposed to fix that I need, so I need this one fixed right away.

Comments

  1. Shannon Hicks 2011-06-20

    As it turns out, it looks like this is the case for any image, not just those in TableViewRows. It was more apparent there due to the number of images.
  2. Paul Dowsett 2011-06-20

    Shannon In order for us to progress this issue, please would you edit your ticket and replace your code with a [Use-case](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases). To summarize, this is the simplest code that will demonstrate the issue, and will run without any modification. You can read more about this in [Submitting Bug Reports](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SubmittingBugReports). Thanks
  3. Shannon Hicks 2011-06-23

    As I said in my first comment, it actually seems to apply to all images. Here are the steps to reproduce: 1. Create a new Android project 2. Insert a remote image, with a defaultImage that is local 3. Run the app. Sometimes the remote image will display, sometimes it won't. The problem was most evident when images were in tableviews, because of the number of images. If you remove defaultImage, the remote image will always load.
  4. Shannon Hicks 2011-06-23

    As a side note, when I create a ticket, I assumed that I was automatically watching it. As a result, I didn't even know you had commented on this ticket. That, combined with my disappearing helpdesk ticket, has really put me behind the 8-ball, as the potential client needs to see this fixed by Monday :(
  5. Paul Dowsett 2011-07-08

    Shannon Reporters are supposed to automatically receive email notifications for all their tickets. Can you confirm whether this is the case, for you? If not, then I will investigate it and get it resolved. I am as eager as you to move this ticket to the correct project, but you have not addressed the issues as is required. Your usecase as it stands contains lots of superfluous code that has no bearing on the behavior you have observed. Also, it does not run *without modification* when pasted into a blank app.js file. I am closing it for now, but will reopen when it has been made sufficient. Please refer to the [Jira Ticket Checklist](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist) if you need any further help with this. Thanks
  6. Shannon Hicks 2011-07-08

  7. Paul Dowsett 2011-08-16

    Closing after 30 days of inactivity.

JSON Source