Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23498] Windows: titleId/title should retain existing value if key not found

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-06-21T18:38:43.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0
ComponentsWindows
Labelsparity
ReporterChristopher Williams
AssigneeKota Iguchi
Created2016-06-10T19:39:02.000+0000
Updated2016-09-05T16:45:21.000+0000

Description

Any of the UI proxies (subclasses of Ti.UI.View) that have *id properties for translation keys need to retain their existing translations/values if the newly set key can't be found. i.e. if we have a title of "Title" and set titled to 'key_that_wont_be_found', the title should stay 'Title' if no key could be found. Test case:
it('titleid', function () {
		var bar = Ti.UI.createButton({
			titleid: 'this_is_my_key'
		});
		should(bar.titleid).be.a.String;
		should(bar.getTitleid).be.a.Function;
		should(bar.titleid).eql('this_is_my_key');
		should(bar.getTitleid()).eql('this_is_my_key');
		should(bar.title).eql('this is my value');
		bar.titleid = 'other text'; // key won't get found!
		should(bar.titleid).eql('other text');
		should(bar.getTitleid()).eql('other text');
		should(bar.title).eql('this is my value'); // should retain old value if can't find key! Windows returns 'other text'
	});
*Classic app*
var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' }),
    button = Ti.UI.createButton({ title: 'BUTTON TITLE', backgroundColor: 'blue' });

win.addEventListener('open', function () {
    button.titleid = "should_not_be_found";
    Ti.API.info(button.title); // should print "BUTTON TITLE"
});

win.open();

Comments

  1. Kota Iguchi 2016-06-17

    Do we have *id property other than titleid/textid? If so let's create new ticket for those. Changed ticket title to describe this ticket is for titleid/textid. PR: https://github.com/appcelerator/titanium_mobile_windows/pull/746
  2. Ewan Harris 2016-09-05

    Verified using: OS: Microsoft Windows 10 Pro 10.0.14393 Appc core: 6.0.0-38 Appc NPM: 4.2.8-6 Ti SDK: 6.0.0.v20160904203840 Lumia 930: 10.0 Lumia 520: 8.1 Original title is retained if the titleid does not exist Closing ticket

JSON Source