Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10262] MobileWeb: Ti.App.Properties 'change' event parity for Mobile Web

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-06-28T23:39:44.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsMobileWeb
Labelsapi, parity
ReporterBlain Hamon
AssigneeChris Barber
Created2012-07-31T10:17:27.000+0000
Updated2018-04-04T23:20:26.000+0000

Description

Taken from TC-1101: added a "change" event to Ti.App.Properties to listen for changes of Properties The test case comes with a settings.bundle in attachment which allows to really test that feature.
var win = Ti.UI.createWindow({
    backgroundColor: 'white'
});

var info = Ti.UI.createLabel();
win.add(info);

var switchButton = Ti.UI.createSwitch({
    top:40,
     value:Ti.App.Properties.getBool('test') // mandatory property for iOS 
});
switchButton.addEventListener('change',function(_event){
    Ti.App.Properties.setBool('test', _event.value);
});
win.add(switchButton);

function onPropertiesChange()
{
    switchButton.value = Ti.App.Properties.getBool('test');
    info.text = 'onPropertiesChange';
    Ti.API.info('onPropertiesChange')
    setTimeout(function(){info.text = '';}, 1000);
}
    
Ti.App.Properties.addEventListener('change',onPropertiesChange);

win.addEventListener('close', function() {
    Ti.App.Properties.removeEventListener('change',onPropertiesChange);
});

win.open();

Comments

  1. Lee Morris 2017-06-28

    Resolving ticket as "Won't Fix" as MobileWeb has been deprecated.
  2. Eric Merriman 2018-04-04

    Closing as will not fix.

JSON Source