Buttons not working
Hi! Titanium noob here so be gentle :)
here is the code…
app.js
var navigationButton = Titanium.UI.createButton({
title : 'NAVi'
});
var navigationWindow = Titanium.UI.createWindow({
url : 'navigationWindow.js'
});
navigationButton.addEventListener('click',function(e)
{
navigationWindow.open();
});
navigationWindow.js
var label = Titanium.UI.createLabel({
text : 'getting GPS settings'
});
var button = Titanium.UI.createButton({
title:'refresh GPS'
});
button.addEventListener('click', function(e){
label.text ='refreshing gps'
});
I have a 3x3 grid of buttons on my app.js and each button opens up a new window. the code above is one of those buttons, the 'navigationWindow.js' contains code to track the users geo location, and this works fine, my problem is, the buttons inside the 'navigationWindow.js' wont trigger any 'click' event, the buttons just float in the screen…right now the buttons are just setup to change a label text. this happens both in the emulator and in the device (using android and iphone)….am i doing something wrong or do I need to add more code on the buttons? please help…Thanks!!!!
2 Answers
-
Irving
I second Aaron's comment. The code you have pasted seems to be incomplete. Would you post it to either pastebin or gist?
Thanks
-
I think I just found the problem, I think its the way im adding my "navigationWindow" to the screen. Is there a way to set an added window to be the active window? I think Im using the latest SDK of Ti, I just updated it…. I am on mac but I am testing it on an android device…