Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15373] iOS: Setting "textid" on a Label after creation does not work

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.2, Release 3.1.3
Fix Version/sn/a
ComponentsiOS
Labelslabe, textid
ReporterMostafizur Rahman
AssigneeUnknown
Created2013-09-30T02:21:18.000+0000
Updated2018-10-03T11:08:02.000+0000

Description

Impossible to set textid property after creation label.
var win = Ti.UI.createWindow();

var lab = Ti.UI.createLabel({
	color: "red",
	text: "text: Hello"
});


//lab.text = L("hello"); // WORKS
lab.textid = "hello"; // DOESN'T WORK

win.add(lab);
win.open();

Comments

  1. Shameer Jan 2014-08-08

    Issue reproduces Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.3.0.GA iOS SDK: 7.1 Building for iOS iPhone Simulator: 7.1
  2. Matej 2014-09-24

    This issue causes another problem - It is not possible to set up textid for a label in ListItemTemplate. Example:
       var win = Ti.UI.createWindow({backgroundColor: 'white'});
       
       var myTemplate = {
           childTemplates: [
               {
                   type: 'Ti.UI.Label',
                   bindId: 'info',
                   properties: {
                       color: 'black',
                       font: { fontFamily:'Arial', fontSize: '20dp', fontWeight:'bold' }
                   }
               }
           ]
       };
       
       var listView = Ti.UI.createListView({
           templates: { 'template': myTemplate },
           defaultItemTemplate: 'template'
       });
       
       var sections = [];
       
       var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits / Frutas'});
       var fruitDataSet = [
           { info: {text: 'Apple'}}, // No problem
           { info: {textid: 'apple'}} // Will not show any title
       ];
       
       fruitSection.setItems(fruitDataSet);
       sections.push(fruitSection);
       
       listView.setSections(sections);
       
       win.add(listView);
       win.open();
       
    Especially annoying in Alloy View when instead of textid="xxx" must be used text="L(xxx)".

JSON Source