Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3529] Android: Ti.Properties do not accept "undefined" as value

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Do
Resolution Date2019-11-14T23:08:43.000+0000
Affected Version/sRelease 2.0.2
Fix Version/sn/a
ComponentsAndroid
Labelsapi, exalture, parity
ReporterPedro Enrique
AssigneeUnknown
Created2011-04-15T03:46:20.000+0000
Updated2019-11-14T23:08:58.000+0000

Description

This is feature request to allow "undefined" to be set as part of Ti.Properties, specifically the setBool and getBool. This works fine on iOS but does not on Android. Currently getBool accepts "true", "false" and "null". There is a http://support.appcelerator.com/tickets/BUQ-42972-167/homepage ticket asking for this.

Comments

  1. Don Thorp 2011-07-18

    setting undefined should have the same effect as setting to null
  2. Junaid Younus 2012-06-28

    The following code works fine on iOS, but on Android it crashes (tested with a Samsung Galaxy S2, TiSDK 2.0.2GA):
     
       var win = Ti.UI.createWindow({ backgroundColor: 'white' });
       
       Ti.App.Properties.setBool('boolValue1', true);
       Ti.API.info('The value of the boolValue1 property is: ' + Ti.App.Properties.getBool('boolValue1'));
       
       Ti.App.Properties.setBool('boolValue2', false);
       Ti.API.info('The value of the boolValue2 property is: ' + Ti.App.Properties.getBool('boolValue2'));
       
       Ti.App.Properties.setBool('boolValue3', null);
       Ti.API.info('The value of the boolValue3 property is: ' + Ti.App.Properties.getBool('boolValue3'));
       
       Ti.App.Properties.setBool('boolValue4', undefined);
       Ti.API.info('The value of the boolValue4 property is: ' + Ti.App.Properties.getBool('boolValue4'));
       
       win.open();
       
  3. Sunila 2013-03-26

    https://github.com/appcelerator/titanium_mobile/pull/4035
  4. Sunila 2013-08-25

    New pull request added https://github.com/appcelerator/titanium_mobile/pull/4600
  5. Hieu Pham 2013-10-22

    The PR doesn't address parity since iOS behaves differently for 'undefined' values. This is part of a larger issue that would require discussion between all the platforms. Bumping it out of 3.2.0
  6. Alan Hutton 2019-11-14

    Closing per comments.

JSON Source