Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15990] BlackBerry: Scroll View - chaotically missing labels

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-12-17T00:28:23.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsBlackBerry
Labelsqe-3.2.0, qe-closed-3.2.0, qe-testadded
ReporterOlga Romero
AssigneePedro Enrique
Created2013-12-13T19:21:33.000+0000
Updated2014-06-19T12:42:40.000+0000

Description

To reproduce

1. Create an app for BB with the following code:
var win = Titanium.UI.createWindow();
 
var scroll = Ti.UI.createScrollView({
    backgroundColor: 'green',
    width: Ti.UI.FILL,
    height: Ti.UI.FILL,
    layout: 'vertical',
    contentHeight:Ti.UI.SIZE,
    contentWidth:Ti.UI.SIZE 
});
 
function MyButton(text) {
    return Ti.UI.createLabel({
        text: text,
        top: 10,
        //width:50
    });
}
 
for(var i = 0; i < 100; i++) {
    scroll.add(MyButton('Label #' + (i + 1))); 
}
 
win.add(scroll);
win.open();
2. Build it for BB device/simulator 3. launch the app & observe the labels

Actual result

*Note* Simulator does not have this issue Different labels are missing when building to device continuously

Attachments

FileDateSize
TIMB97987.png2013-12-13T19:21:33.000+000074835
TIMB979872.png2013-12-13T19:21:33.000+000076335

Comments

  1. Pedro Enrique 2013-12-16

    PR for 3.2.x: https://github.com/appcelerator/titanium_mobile_blackberry/pull/197
  2. Pedro Enrique 2013-12-16

    PR for master: https://github.com/appcelerator/titanium_mobile_blackberry/pull/198
  3. Pedro Enrique 2013-12-16

    The problem is that a JS value comes in for the key of the object:
       {
               text: text,
               top: 10
       }
       
    In this case the "text" property. To convert it to a c++ const char* we were using the function V8StringToQString(Handle) and then extracting the const char* from the QString. The problem is that this function will not always return the correct string, sometimes it returns garbage, like "%@fd1!" instead of "text", for no reason. To fix it, just bypass that function and use the V8 API to get a const char* directly: *String::Utf8Value(Handle)
  4. Olga Romero 2013-12-17

    Tested and verified the fix with: Appcelerator Studio, build: 3.2.0.201312162210 Titanium SDK, build: 3.2.0.v20131216191854 CLI 3.2.0-cr3 Alloy 1.3.0-cr2 BBZ10 10.1.0 No more missing labels.

JSON Source