Sunday, 8 May 2011

Added new feature - Shake to Clear values (reset)



After submitting the app, I have decided to add 1 minor feature - shake it to clear values. You can get this beta app from HP webOS App Catalog.

Codes:
WAIAssistant.prototype.clearValues = function(){
// Clear all the values
this.controller.get('txtLatitude').mojo.setValue ('');
this.controller.get('txtLongitude').mojo.setValue ('');
this.controller.get('txtMobile').mojo.setValue ('');
}

WAIAssistant.prototype.handleShaking = function(event) {
this.clearValues();
}

WAIAssistant.prototype.activate = function(event) {
this.controller.listen(document, 'shaking', this.handleShaking.bindAsEventListener(this));
};

No comments:

Post a Comment