Ti.APP.addEventListener behaving strangely?

隐身守侯 提交于 2019-12-13 05:30:56

问题


MainWindow.js

Ti.App.addEventListener('checkFirstName', function(e) {
    FirstNameTextField.text =  'First Name ' + e.FirstNameValue
});

Ti.App.addEventListener('checkLastName', function(e) {
    LastNameTextField.text =  'Last Name ' + e.LastNameValue
});

Ti.App.addEventListener('checkGender', function(e) {
    GenderTextField.text =  'Gender ' + e.GenderValue
});

Ti.App.addEventListener('checkDateOfBirth', function(e) {
    DateOfBirthTextField.text =  'Date of Birth ' + e.DateOfBirthValue
});

ChildWindow.js

DoneButton.addEventListener('click', function() {
      FirstNameWindow.close();
});


FirstNameWindow.addEventListener('close', function() {
    Ti.App.fireEvent('checkFirstName', {
        FirstNameValue:FirstNameField.value
    });

I have four listener's in my main Window which updates the values of Text Fields in a TableViewRow. The TableViewRow is dynamic as each row gets populated on click of button.

When i click on my first button, the row gets populated and clicking on it navigates to child window from there i update the value back to my row. But for the second, third and fourth it does not. But when i add another row with a click of button... the value gets populated.

来源:https://stackoverflow.com/questions/5723534/ti-app-addeventlistener-behaving-strangely

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!