[TIMOB-11894] Android: TableView - If you dynamically add items to the TableView, subsequent items will not appear in the table
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-11-30T22:07:54.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.0.0, Release 3.1.0, 2012 Sprint 24, 2012 Sprint 24 API |
Components | Android |
Labels | api, module_tableview, qe-and100112, qe-testadded, regression |
Reporter | Wilson Luu |
Assignee | Ingo Muschenetz |
Created | 2012-11-29T19:02:18.000+0000 |
Updated | 2013-07-17T11:10:53.000+0000 |
Description
*Details:* If you dynamically add items to the TableView, subsequent items will not appear in the table.
*This is a regression.* Bug does not appear in 2.1.4.GA and does not appear on iOS.
*Steps to reproduce:*
1. Add the following code to app.js:
var win = Ti.UI.createWindow({
backgroundColor:'#000',
layout:'vertical'
});
var message = Ti.UI.createTextField({
hintText: 'Enter message',
height: 100,
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
message.addEventListener('return', function (evt) {
if (!message.value) {
return;
}
addMessage(message.value);
message.value = '';
message.focus();
});
win.add(message);
var tableView = Ti.UI.createTableView({});
win.add(tableView);
win.open();
function addMessage(message) {
var row = Ti.UI.createTableViewRow({});
var container = Ti.UI.createView({
height: Ti.UI.SIZE,
backgroundColor: '#fff',
borderColor: '#ccc', borderWeight: 1
});
var label = Ti.UI.createLabel({
text: message,
font: { fontSize: 12, fontWeight: 'bold' },
height: 50
})
container.add(label);
row.add(container);
if (tableView.data.length == 0) {
tableView.appendRow(row);
}
else {
tableView.insertRowBefore(0, row);
}
}
2. Install and launch app to an Android device
3. Enter at least 3 messages
*Actual:* On the S3, three or more messages will not be added to the TableView (see s3_3_0_X.png)
On the Droid 1, you will only see 1 message. Subsequent messages will not appear (see droid1_3_0_X.png)
*Expected:* Adding messages should appear in the TableView (see 2_1_4_GA.png)
Attachments
File | Date | Size |
---|---|---|
2_1_4_GA.png | 2012-11-29T19:02:18.000+0000 | 76809 |
droid1_3_0_X.png | 2012-11-29T19:02:18.000+0000 | 48327 |
s3_3_0_X.png | 2012-11-29T19:02:18.000+0000 | 76464 |
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3502
Backport to 3_0_X https://github.com/appcelerator/titanium_mobile/pull/3503
Tested with 3.0.0.v201211300200208 on Galaxy S3 4.0.4