Community Questions & Answers
Android Mapview Longpress Event
At the moment i am working on an app which uses the map module. Now i want the user to be able to create custom annotations by a long press like in the vanilla maps app on android. This works fine on the iphone by adding an eventlistener to the mapview....
Change View Background Selected Color On Click Event of a image
I am making a application where i need to change the background selected color on click event of a buttonmy code is as follows but it's not working help me.. var likeView =...
Listening to Facebook window's open, close, focus, blur events
Is there a way to listen to the Facebook login window's `open`, `close`, `focus`, and `blur` events?
Shifting from one window to another
I am new to this. I am having button on 1st screen and after clicking on the button It goes to the next Screen where it displays some data. But while doing so, the earlier window still can be seen in background so how to overcome the same?
Detect click on webview to fire event to app
Hi I'm using SDK 3.1 I'm trying to fire an event in a webview and detected it at app level. I've followed all the post I have found on this subject but I cannot make it work. I need to attach an event listener to all images, which are generated from the...
Unable to get e.globalPoint.x in Titanium iPhone development
I am trying to get globalPoint in Titanium iPhone application when touchmove event occur, I use following code to get globalPoint ~~~ var x = parseInt(e.globalPoint.x, 10); ~~~ It work fine until I updated Titanium 3.0.2 GA to 3.1.0 GA, after updating I...
WebView 'load' event fires multiple times
When loading certain pages in a webview the load event fires many many times, it even causes Titanium (not the iOS simulator) to crash! EDIT: Forgot to mention it also fires way too soon, long before it has loaded completely. That's my main problem...
Sound event listener.
Hi, is there any possibility to use an sound event listener to trigger something? For exemple, if I clap my hand or whistle I get an animation, I change my view to another one or slide my scroll view? The purpose is to interact with the device without...
Not able to capture events at Webview
@All: I am using webview with two iframe inside index.html , iframe having src like page1.html, page2.html and then i fired event from titanium and trying to capture it at webviews js but im not able to capture event from titanium. i just wonder if set...
Webview with Ifame not able to capture app event
*@All:* I am using webview with two iframe inside **index.html** , iframe having src like **page1.html**, **page2.html** and then i fired event from titanium and trying to capture it at webviews js but im **not able to capture event from titanium**. i just...
Transform Problems in Android
I am having a problem getting transforms to work in Android. I am probably missing something simple, but if I apply a transform to a button when I create it, the button click event listener does not work anymore. However, if I uncomment the last line and...
commonJS module and EventListener
Hi everyone, I'm working on getting a bunch of clickable images within a scroll view. The code I came up with for this is allProducts.js ~~~ var win = Titanium.UI.currentWindow; win.backgroundColor = '#336699'; var scrollView =...
click event on Map.View does not fire if title property isn't set
I'm using SDK 3.1 and I don't want to display the full annotation when the user clicks on it, I just want to show the pin on the map and detect the click to show an overlay view. In order to do that, I create the annotation without the `title` property. It...
how to speed up remote facebook data retrieval / make functions wait for remote data retrieval to complete
i have an app that retrieve data from facebook to populate a local sqlite database. there's a list of items in a tableview using those data retrieved. when users click on a row a detailed page will appear. in that page, users can like/unlike the particular...
Can't click tableView row on empty space when checkbox added into the row
hi, i make simple tableview from this code: ~~~ function addTableViewRow(/*String*/ keterangan, /*String*/ jumlah, /*String*/ amount){ var tableViewRow = Titanium.UI.createTableViewRow({ height:'35dp', backgroundColor:(rowCount%2 === 0) ?...
Android hardware Menu button eventlistener.
So I have found how to listen for the search button and the back button on an android app however is there can't find anything on detecting a clicked menu button. Many recent apps have a button for menu on android and apple on the screen and the hardware...
Animation Complete and Firing event But I dont see the Animation on Screen
I have a long press event listener setup and an animation then once complete it takes me to a new page. However i dont see the animation the row i long press on simply blinks and then takes me to the next page. When i check the order of events them seam to...
Click isn't registered after another click
Sometimes on iOS devices the click on some element is not being registered for some reason. This happens when rapidly clicking on some random spot and right after that clicking on the element. Code to reproduce: var clickTest =...
Why does removeEventListener need a callback?
Just a simple one. Is there any real reason why a callback is required for removeEventListener? Am I supposed to be doing something with it? example: `myView.removeEventListener('click');` wont work, it gives an index beyond bounds error. neither will...
Add Event Listener for image not WORKING????
Hi everyone Add event listener in sub pages not working. Dose any one know the reason?? here is my app.'s ~~~ var win = Titanium.UI.createWindow({ backgroundImage: 'images/44.jpg', //opacity: .4 }); win.orientationModes = [Ti.UI.LANDSCAPE_LEFT,...
Webview eventListeners and fireEvents seem to work/not work completly random.
so I'm working on an application that uses webview to display data. At the moment i'm trying to get data from, and send data to the webview. It seems that getting data from the webview works fine, but sending data back to the webview forms the problem. I...
Picker change event not firing on first select (mobile)
Hi all. I am populating a picker using a loop as follows: ~~~ var unionData = []; var unionPicker = Titanium.UI.createPicker({ top:65, width:160 }); function populateUnionPicker() { Titanium.API.debug('Populating union picker ... '); for(var...
Android Java module - creating eventListener
Hello, I'm a newbie to Titanium and I wish to create a external module for Android. Specifically, I want to to be able to call something like proxy.addEventListener('click', function()) with a result from the module (e.g. if a click on an item from my...
Invoke fireEvent in Native Android module and Listening it from Titanium Js
I want to fire an event from native android module and listen in on Titanium. I created a class in native module call Detector extending Kroll Proxy. ~~~ package com.detect.test; import org.appcelerator.kroll.KrollProxy; public class Detector extends...
Event Listerer wont work
Messages.addEventListener("click",function(e){ label.text = e.source.image; Messages.removeEventListener("click",function(e){}); }); The error say : Uncaught ReferenceError: label is not defined at /app.js (line 35)
'undefined' is not an object (evaluating 'Ti.UI.currentTab.open')
Hi, I have a table view in a window and ad trying to open another window on click of a tableview cell click. This is what I have for the event: ~~~ tableview.addEventListener('click', function(e) { self.fireEvent('settingSelected',...
Animate imageview added to tableviewrow
Hey, I'm trying to make a tableview by adding a couple of views to a tableviewrow, and want to animate an imageview from opacity 1 to 0 on click, and reveal another imageview by animating from 0 to 1, and revert on clicking the hidden view. ~~~ ui =...
CommonJS and Event Listener calling prototype function
I am trying to have Event Listener call a prototype function (method?) inside a CommonJS object as follows: ~~~ MainMenuEntry.prototype.initializeEventListener = function() { this.mainMenuEntryView.addEventListener("click",...
Date() value gets changed when passed via events
I'm not sure if this is an Alloy or a general problem with 3.1.0.GA. I have built a simple Alloy test case that passes a date object between two controllers by firing Ti.App.fireEvent. Tested in iOS 6.1 simulator on Mountain Lion. Titantium 3.1.0.GA. ...
Android Windows Dont Animate
when my button get clicked, then is executed this code: ~~~ but_iniciar.addEventListener('click',function(e) { var win = Ti.UI.createWindow({ url:"home.js" }); win.open({animated:true}); }) ~~~ but the problem is that the...
Is there a way to send+receive events from an Alloy widget?
Something like: ~~~ <Widget src="my.widget" onDing="myFunction"/> ~~~ Then in my.widget: ~~~ fireEvent('ding', { data: 'dong' }); ~~~
Question about eventListeners
How would a more experienced programer go about turning an eventListener on and off ? I have a 'touchstart' listener which is placing a dot on the screen and counting the dots.... the way I have it now the event listener keeps firing ! touch first time...
Resume event doesn't fire
I'm building an app that when pause, it will clear the whole window and on resume, all the view will be built again. Now if i press the home button and back to app, the pause and resume events works. But if I pull down the notification center and pull it...
Event listener in webview not working on Android
I have a webview that features HTML from the local filesystem. In the page's JavaScript I'm adding an app-level listener to listen for events from Titanium using the following code: ~~~ Ti.App.addEventListener("app:fromTitanium",function(e) { ...
Opening a new window from an event listener in an app with no tabs
I am trying to open a new window from an event listener but every time I try, I get the error, "Script Error = 'undefined' is not an object (evaluating 'Titanium.UI.currentWindow.open') at app.js" I am coding for iOS and using the latest...
Android: Uncaught type error:cannot call method open of null
Hi all, i have a problem in my app everytime i click a button to open another window it doesn't work and i get this message " Uncaught type Error: cannot call method 'open'of null" Please can someone help to resolve this Thanks for all the...
How to add a click listener to a label in a TableViewRow?
I'm looking at the todomvc sample app on github (https://github.com/appcelerator-titans/todomvc) and it has exactly what I want in terms of a check box on each row of a TableView. I'm using Alloy databinding to populate the table. Each row has a Label...
Double click causing "nested push animation can result in corrupted navigation bar" error
Hi I came across this error by accident and I'm wondering anyone else has seen it. (Using Titanium 3.0.2, iOS 6, Mac OSX Mountain Lion, Titanium Alloy). I have the following code: ~~~ function addMeals(meal, food, target, index) { var foodRow =...
Get Pixel color onClick event
I am able to get the x-coordinate and y-coordinate of view where i clicked,Is it able to know the color of the Pixel(Area) where i clicked or the color of the associated pixel(area) at give xy-coordinates. $.drawview.addEventListener('click', function(e)...
Alloy + External Module
I'm using a third party module in my Alloy project and am running into an issue - the events from the module seem to be firing inconsistently, or sometimes not at all. * If the module is called in the index controller, the event will fire three or four...
Detect click event over arrow in tableviewrow
In a tableview, every row has the property hasChild = true can I detect if I clicked on the arrow instead of the row? Thanks a lot :)
Android Looping EventListener Problem
Hi, I'd like to create views dynamically and attach an eventlistener for each of them. However I am failing to do so. Only last one get the listener. Here is my code. Thank you. --- My specs --- Android emulator / Mac OS 10.8.2 / Mobile SDK 3.0.2GA /...
Application not working on Alloy
Hi guys, I have created an application on alloy. I am using alloy 1.1.0, node js 0.10.0 . After running this application app is deployed successfully and giving first page also. But on clicking a link, next window is not opening.
Pause & Resume events don't fire! Android.
Hi guys, The title kind of says it all! I even get the Red Screen of Death from one of the most commonly recommended solutions ~~~ Uncaught TypeError: Object # <Object> has no method 'addEventListener' Source:...
Android: two event fire on the same time
I have implement a row and inside the row i add in an image, both tableview and image have their own event but when i click on the image, the tableview event will also be triggered. I only want the image event to triggered not the tableview event. How can...
Check if an object has an event listener
Is there a way to check if an object has an event listener, to decide whether to add or remove the event listener. So for example: ~~~ function doStuff(){ //check if object has event listener if(object has event listener){remove it else{ alert('no...
facebook addeventlistener not capturing login event
Hi, The login event is not captured in this code (the ti.facebook.addEventListener is never executed) : ~~~ Titanium.UI.setBackgroundColor('#000'); Titanium.Facebook.appid = "#####"; Titanium.Facebook.permissions = ['publish_stream',...
event listener stops firing after 2 clicks
This is my first Titanium app so any help would be greatly appreciated. I have been searching all over for a solution for this. I have seen similar problems but haven't found anything that works for me. I have a tabgroup with a window that holds two...
Android EventListeners not being removed
Hello all, I am currently working on a project wich has a lot of work with math functions. The only way to implement it was to use Ti.App.fireEvent and Ti.App.addEventListener. While in iOS it is working fine, when I started the conversion to Android, I...
If Statement for Event Listeners
- Latest Titanium SDK iOS Application - Trying to get it working on iOS 4.3 and above. - Working off a Mac, OSX Mountain Lion. Hi, Is there a way to check what event listener has been activated and then display that code using an if statement. One of the...