Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14305] iOS: Label: Label displays incorrect text when textid property of label is assigned with key that is missing and does not update the label value when assigned with correct key in textid.

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.2
Fix Version/sn/a
ComponentsiOS
Labelsqe-3.1.2, reprod
ReporterPriya Agarwal
AssigneeUnknown
Created2013-06-20T09:15:18.000+0000
Updated2018-02-28T20:04:15.000+0000

Description

Label displays incorrect text when textid property of label is assigned with key that is missing and does not update the label value when assigned with correct key in textid. This is not Regression because issue appeared in 3.1.1GA also. Steps To Reproduce: 1.Create an app with code below and copy paste the attached file in the created app after downloading. 2.Click on the view Expected Result: 1.Window must get opened with no text in it. 2.Must get the updated text on label "Welcome to Kitchen Sink for Titanium updated" Actual Result: 1.Window get opened with text as "Testlabeltextid" in it. 2.Label does not get updated with "Welcome to Kitchen Sink for Titanium updated" value. It remains "Testlabeltextid".

// START: APM service code injection
// Require the apm module
var apm = undefined;
try {
apm = require("com.appcelerator.apm");
}
catch (e) {
Ti.API.info("com.appcelerator.apm module is not available");
}

// Initialize the module if it is defined
apm && apm.init();
// END: APM code injection

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');


var win = Titanium.UI.createWindow({
	backgroundColor : 'white',
}); 

var view = Ti.UI.createView({
	top : 0,
	height : 80,
	right : 0,
	left : 0
});
          
var label =  Ti.UI.createLabel({
    font:{fontSize:30,fontFamily:'Helvetica Neue'},
    color:'red',
    left:0,
    width:'100%',
    borderColor:'red',
    borderWidth:'3',
    textid:'Testlabeltextid',// "Testlabeltextid" key does not exists in strings.xml so it must not display any text on label but it displays"Testlabeltextid" on label.
    right:'10%'
    
});

view.add(label);

view.addEventListener('click', function(e) {
	
	label.textid = 'welcomeupdate';// it must update the labels text but it does not update the label text.
	Ti.API.info('updated textid of label:'+label.textid);
});
    
win.add(view);                
win.open();

if (Ti.Platform.osname === 'iphone' || Ti.Platform.osname === 'ipad')
{
  var touchTestModule = undefined;
  try
  {
    touchTestModule = require("com.soasta.touchtest");
  }
  catch (tt_exception)
  {
    Ti.API.error("com.soasta.touchest module is required");
  }

  var cloudTestURL = Ti.App.getArguments().url;
  if (cloudTestURL != null)
  {
    // The URL will be null if we don't launch through TouchTest.
    touchTestModule && touchTestModule.initTouchTest(cloudTestURL);
  }

  Ti.App.addEventListener('resumed',function(e)
  {
    // Hook the resumed from background
    var cloudTestURL = Ti.App.getArguments().url;
    if (cloudTestURL != null)
    {
      touchTestModule && touchTestModule.initTouchTest(cloudTestURL);
    }
  });
}

Attachments

FileDateSize
i18n.zip2013-06-20T09:15:18.000+0000545

Comments

  1. Lee Morris 2017-06-19

    I am able to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170609091155 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source