Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15682] Android: ListView not updating items properly

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-11-07T18:42:31.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2013 Sprint 23, 2013 Sprint 23 API, Release 3.2.0
ComponentsAndroid
Labelsapi, module_listview, qe-manualtest, qe-testadded, regression
ReporterHieu Pham
AssigneeHieu Pham
Created2013-11-07T00:38:10.000+0000
Updated2014-10-16T00:59:22.000+0000

Description

ListView doesn't update items correctly when multiple templates are used. This is a regression (Works in 3.1.3.GA, fails with latest master). Testing code:
var win = Ti.UI.createWindow();
 

var viewTemplate = {
    childTemplates: [
     {
         type: 'Ti.UI.View',
         bindId: 'View',
         properties: {
             height: '50dp',
             backgroundColor: 'red'
         }
     }
    ]
};
 
var items = [
    { template: 'View'}
];
 
for ( var i = 0; i < 20; i++) {
    items.push({ properties: { title: 'Item', height: '50dp'}});
}
 
var section = Ti.UI.createListSection({
    items: items
});
 
var listView = Ti.UI.createListView({
	backgroundColor: 'black',
    templates: {
        'View': viewTemplate
    },
    sections: [ section ]
});
 
win.add(listView);
win.open();
1. Run code. There should be only one red view in the list view - The first item. 2. Scroll back and forth. Notice the red view changed position. Expected Result: There should only be one red view in the list view, and scrolling shouldn't modify its position.

Comments

  1. Hieu Pham 2013-11-07

    master PR: https://github.com/appcelerator/titanium_mobile/pull/4924
  2. Lokesh Choudhary 2013-11-09

    Verified the fix. The red view does not move on scrolling the listview. Closing. Environment: Appcel Studio : 3.2.0.201311080232 Ti SDK : 3.2.0.v20131108155642 Mac OSX : 10.8.5 Alloy : 1.3.0 CLI - 3.2.0 Device: Samsung Galaxy S4 running android 4.2.2

JSON Source