Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4206] Android: Image on table view cannot be dynamically changed

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-11-05T13:50:09.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sSprint 2011-24, Release 1.7.2, Release 1.8.0
ComponentsAndroid
Labelsn/a
ReporterPedro Enrique
AssigneeBill Dawson
Created2011-05-24T15:36:03.000+0000
Updated2011-11-05T13:50:09.000+0000

Description

Tried with two different codes:
var win = Ti.UI.createWindow();
var table = Ti.UI.createTableView();
var data = [];
for(var i = 0; i<30; i++){
	var row = Ti.UI.createTableViewRow();
	row.img = Ti.UI.createImageView({
		image:'KS_nav_ui.png'
	});
	row.add(row.img);
	data[i] = row;
}

table.data = data;

table.addEventListener('click', function(e){
	e.row.img.image = 'KS_nav_views.png';
});

win.add(table);

win.open();
And this one:
var win = Ti.UI.createWindow();
var table = Ti.UI.createTableView();
var data = [];
var clicker = function(a, b){
	a.addEventListener('click', function(e){
		b.image = 'KS_nav_views.png';
	});
}
for(var i = 0; i<30; i++){
	var row = Ti.UI.createTableViewRow();
	var img = Ti.UI.createImageView({
		image:'KS_nav_ui.png'
	});
	row.add(img);
	clicker(row, img);
	data[i] = row;
}
table.data = data;
win.add(table);
win.open();
This creates a simple table view with an image view on each row. The goal is to change the image inside the rows when a row is clicked.

What's supposed to happen:

When a row from the table view is clicker, the image within should change to the other one on the listener. This happens with iOS.

What happens:

Nothing changes

Helpdesk ticket:

APP-377288

Comments

  1. Pedro Enrique 2011-05-31

    There is another helpdesk ticket also waiting for this to be fixed. http://support.appcelerator.com/tickets/APP-954973/homepage
  2. Don Thorp 2011-06-15

    Tested both cases.
  3. Natalie Huynh 2011-07-06

    Tested with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836
  4. Don Thorp 2011-11-05

    Standardizing summary and labels.

JSON Source