Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11745] iOS TableViewRow structures for className meh does not match

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-11-21T22:15:29.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 24, 2012 Sprint 24 Core
Componentsn/a
LabelsTableViewRow, qe-port, regression, triage
ReporterPedro Enrique
AssigneeMax Stepanov
Created2012-11-12T23:05:39.000+0000
Updated2013-01-15T02:55:15.000+0000

Description

The problem

In the 3.x CI SDK, the table view rows act funny when className is used. They are not consistent and a message in the log reads:
[ERROR] TableViewRow structures for className meh does not match
Some of the symptoms are the fact the the label disappears sometimes, or the height of the row changes randomly.

To reproduce

var win = Ti.UI.createWindow();
var table = Ti.UI.createTableView();

function Row(name) {
    var row = Ti.UI.createTableViewRow({className: 'meh', reusable: true, height: Ti.UI.SIZE });
    row.add(Ti.UI.createLabel({text: name}));
    return row;
}

function reloadOne() {
    var data = [
        Row('Row 1'),
        Row('Row 2'),
        Row('Row 3'),
        Row('Row 4')
    ];
    
    table.setData(data);
}

function reloadTwo() {
    var data = [
        Row('Row 5'),
        Row('Row 6'),
        Row('Row 7'),
        Row('Row 8')
    ];
    
    table.setData(data);
}
win.add(table);

var btnOne = Ti.UI.createButton({
    title : 'click',
});
var btnTwo = Ti.UI.createButton({
    title : 'click',
});

btnOne.addEventListener('click', reloadOne);
btnTwo.addEventListener('click', reloadTwo);

win.rightNavButton = btnOne;
win.leftNavButton = btnTwo;

win.open({modal:true});
Copy and paste this into app.js and run it. Click on the buttons on the navigation bar to change the table data.anges randomly.

To reproduce

var win = Ti.UI.createWindow();
var table = Ti.UI.createTableView();

function Row(name) {
    var row = Ti.UI.createTableViewRow({className: 'meh', height: Ti.UI.SIZE });
    row.add(Ti.UI.createLabel({text: name}));
    return row;
}

function reloadOne() {
    var data = [
        Row('Row 1'),
        Row('Row 2'),
        Row('Row 3'),
        Row('Row 4')
    ];
    
    table.setData(data);
}

function reloadTwo() {
    var data = [
        Row('Row 5'),
        Row('Row 6'),
        Row('Row 7'),
        Row('Row 8')
    ];
    
    table.setData(data);
}
win.add(table);

var btnOne = Ti.UI.createButton({
    title : 'click',
});
var btnTwo = Ti.UI.createButton({
    title : 'click',
});

btnOne.addEventListener('click', reloadOne);
btnTwo.addEventListener('click', reloadTwo);

win.rightNavButton = btnOne;
win.leftNavButton = btnTwo;

win.open({modal:true});
Copy and paste this into app.js and run it. Click on the buttons on the navigation bar to change the table data.

Comments

  1. Max Stepanov 2012-11-20

    PR https://github.com/appcelerator/titanium_mobile/pull/3451
  2. Max Stepanov 2012-11-21

    3_0_X PR https://github.com/appcelerator/titanium_mobile/pull/3464
  3. Anshu Mittal 2013-01-15

    Tested with: SDK: 3.0.0 GA, 3.1.0.v20130108153753 Studio: 3.0.1.201212181159 Device: iPad2(v 5.1) No error in the console stating that TableViewrow structures for classname meh do not match

JSON Source