Titanium Alloy Textfield on Focus #13564
Unanswered
beppo-ivel
asked this question in
Q&A
Replies: 1 comment 11 replies
-
If you look at the textfield.js code and change it to this: exports.getInputText = getInputText;
exports.addEventListener = addEventListener; // <- was missing
function getInputText() {
return $.customTxtField.value;
}
function addEventListener(event, callback){
switch(event) {
case "focus":
$.customTxtField.addEventListener('focus', callback);
break;
default:
}
} it works fine. I see the |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to add event listener "on focus" for the $.txtOne element. I tried different methods.
addEventListener
function and by define my ownaddEventListener
function. But both ways throw same error:But don't understand why
addEventListener
is not a function, even if I defined my own functioncontrollers/components/textfield.js
? For example the definition of$.txtOne.getInputText()
is working.views/components/textfield.xml
views/test.xml
controllers/test.js
controllers/components/textfield.js
Beta Was this translation helpful? Give feedback.
All reactions