I have a created a project(classic) for mobile web using titanium. I have created a textfield.
var txtField = Ti.UI.createTextField({ id:"txtId", value:"txtValue"});
I have added an event "Change".
txtField.addEventListener('change', function(e){alert("change event fired");});
after that when I am trying to change that value programmatically like
txtField.value = "Someothet text"
The change event is not triggered. Can any one please help me regarding this.
Thanks in Advance, Swathi.
As far as I know it will only fire the "change" event when modified in the user interface. And you would also like to have a means of changing a value without firing the "change" event ;-)
You write that you have created a wrapper class. Then you should create a "setter" function (e.g. "set" or "setValue") in that wrapper class to set the value. Within the setter you will set the value AND fire the change event. This way you only have to maintain the change logic in one place.
HTH
/John