Community Questions & Answers
iPhone Geolocation never turns off
This has worked in previous builds with earlier SDKs, but now, after listening for geolocation events, when I use `removeEventListener`, the location arrow never goes away. The method returns void, so I have no way of knowing if that failed for some...
Detect Keyboard Visible
Is it possible to detect if the software keyboard is visible on iOS? I'm trying to make it so a view expands if there's a hardware keyboard in use.
Any way to detect when a devices screen is off?
Is there a way to detect when a device's screen is off? I have an app that uses GPS and would like to disable the GPS when the screen is off to save battery power. I'm hoping there is a listener that can be triggered when the device screen is turned off,...
How to check if a listener exists ?
Hi, I have a local webview and im using addEventListener to add a new listener. I have this: ~~~ Ti.App.addEventListener('saveClient', function(e){ // My code... }); ~~~ This is inserted into a js function. How can I check if a event Listener exists...
How to apply long press event in Titanium webview
I done this using single on click. But i unable to apply with long press Event. Please help me to do this.
Add event listener to an element loaded in a webview
I am working on a sample app using titanium. I have created a webview and loaded a local html as shown below ~~~ var webview = Ti.UI.createWebView({ borderWidth:0, paddingRight:10,width:310,top:25, height:210,left:5 }); webview.html =...
Android, adding event listeners before defining their handlers (functions)
Hi, I encountered a weird issue on my android production build. Until now, I structure my code declaring all the functions on the bottom part of my commonjs files. For example: ~~~ module.exports = function(){ var win = Ti.UI.createWindow(); (other...
What is KrollCallback and why does my fireEvent fail when a listener is present?
I am creating a new window with Ti.UI.createWindow({url:'page.js'}); In page.js, I create a Ti.UI.WebView and try to attach some listeners. The listeners are passed in to the page.js with an object win.listeners = { 'event_type' : function() {...
Button not being clicked or blink
Hi i have come across a very strange type of problem.The problem is that when it is clicked it does not show any response.It does not even change its color to yellow like it does when button is clicked.Is this possible plz tell me
Android Local Notification Event Listener
is there an event listener like the one on IOS: ~~~ Ti.App.iOS.addEventListener('notification', function(e){ alert(e); }); ~~~ but then for android?
Event listener not working
Hi my button event listener is not working.It was working till yesterday correctly but now it is not working var GlobalVar=new Array(); GlobalaVar=["PHP Web Developer","Drupal Developer"]; var win5 =...
How to fire an event in a Module and catch it in JS
Hi Guys, i working with modules. I want to fire an event in the Module and catch the event with an eventListener in JS. Here is my Module snippet: ~~~ -(id)example:(id)args { // example method [self _fireEventToListener:@"my_event"...
Notification event listener when app start from cold
Hi My iOS app needs to run an event every time it is opened by a local (or push) notification alert. The problem seems to be that the Ti.App.notification event is not captured by the listener when the app is not in background, probably because it is not...
Click image in table row
In my app, I'm looping through my results, and one thing I'm adding in each row is an image, that a user will click to delete. I have an event listener for my table (as opposed to each row), and I have one added to my delete image individually. When I...
how to send data between js file on Titanuim ??
I wanna to send data between js files and windows using the fire event !!!! But I 'don't know how ???? any indications please ?? I 'am new on Titanuim tha's why I'am blocked here Thanks a lot :)
event to webview throws an exception
When I click on a tablerow, I fire an event: ~~~ tablerow.addListener('click',function(e){ Ti.App.fireEvent('onMeasurement',{ rfid:e.source.rfid }); }); ~~~ I have a WebView with a javascript event listener: ~~~ <script...
Ti.App.fireEvent Not Working - Code examples inside
I have a Ti.App.fireEvent and a Ti.App.addEventListener set up as you can see in the examples below. It is supposed to detect if a user who has previously logged in had selected to store their login info and auto login. Well, it isn;t working and I am not...
image load
Hello, in a simple imageView property how can i add a listener for the image if loaded, i just want a alert if image loaded, ~~~ var myimage = Ti.UI.createImageView({ image:'http://www.xxx.com/1.jpg', defaultImage:'default_image.png', ...
get the number of listeners of an object
can I obtain the number of event listeners a view has?
VideoPlayer "click" eventListener doesn't seem to fire
I want to call a function via fireEvent when someone plays a video (with hidden controls on repeat). If I place an image over the top of the video, it works perfectly. But when I try to use the listener directly on the video (or on the window), it doesn't...
Using Event Listener to set value variable
Below is my code... ~~~ dialog.addEventListener('click',function(e){ if(e.index == '0'){ return carSelected = 'car1'; }else if(e.index == '1'){ return carSelected = 'car2'; } }); ~~~ I can't seem to get the variable out of the event listener....
Textfield on Delete
How do I get notified when a user presses the delete button on a textfield?
map view loading event not firing
On *[https://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.Map.MapView.html](https://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.Map.MapView.html)* is a list of the events I can attach to the map view. I want a function to run when the...
Howto recognize "pinch" gesture by touchmove event?
How can I recognize a pinch gesture on a ImageView for example? Has anyone already implemented a listener like that by handling the touchmove events in some way? (I want to scale an image with an animation as soon as the user does a pinch gesture on it,...
Capturing custom URL automatically and open
You can make an application to titanium desktop open when the browser tries to open a url like myapp://myhost.com.br/2934239849823 I would like the desktop application open by itself, thus capturing the url above, listner,etc? The idea is to allow the...
When i click a view the log showes error 'Error invoking listener with id 1 on eventName 'click''
The view is added into the window automatically
I can't add again a listener previously removed
Hello, I came around a curious problem to which I can't find an explanation. Let's say I add an event listener: ~~~ ApplicationVideo.addEventListener('complete',videocomplete); ~~~ Then later in the code I remove...
How to assign listeners to tableViewRows in a loop
Hi - I'm trying to assign listeners to table view rows in a loop but no matter what the loop takes the final url value of the loop rather than its specific indexed url. Here's my code: ~~~ var tweetLinks = []; var tweets =...
Single Event Listener with Multiple Text Fields
Hi, I am wondering how I can have one event listener (onclick) which is fired when any of the text fields are clicked (clicked and the keyboard pops up). Thanks in advance.
Open New Window From Picker?
Hi there, I am developing an application at the moment and I am trying set up a picker in which users can select an option and it takes them to a page appropriate to their choice. However I am having trouble opening the selected page, can someone...
How do you detect the orientation change on just one tab?
I have 3 tabs. I want to detect orientation change and show a new window on tab 1 only. However the other 2 tabs are still detecting the orientation change. Is it possible to only detect orientation change on just tab 1?
cannot get updated GPS on android, please help, urgent ^^
Hi, hope you doing great, i'm stuck with GPS, i used Current location but it always give me old saved position, i added the location listener also but as it doesn't show the radio sign nor do it gets the latest update. Moreover i can't get it working over...
How to remove an EventListener in another view
I have my main window with a tabgroup. In the first tab it leads to a map event where I want the shake gesture to open up the built in map for directions. In the second tab I want the shake gesture to show a message, I was wondering if this was possible to...
Intercept http request for image
Hi all, I want to know if it's possible to intercept the http request of any image got from a server? It's for waiting the real showing of the image and do not create an image view before. Thanks a lot. M.
Listener not reacting? Help please?
I am programming an App on the iPhone, with Titanium Developer 1.2.2. My app.js simply calls an image (splash screen), then on a click will go to the main win: ~~~ Titanium.UI.setBackgroundColor('#000'); var win = Titanium.UI.createWindow({ title:...
[Android] Ti.App.fireEvent not detected on some devices
I am testing my application on Android devices, and while it works perfectly on one device, there is another device that does not detect an event. The code is pretty simple: ~~~ //app.js Ti.App.addEventListener('loggedIn', AppListener.loggedIn); //in my...
click event works only from time to time
Hi there ! I had the problem weeks ago, no one could help me, so i recreated my app new from the scratch, but now i have the exactly same problem that makes my crazy ! What's the problem ? ----------------- I have a window and some buttons....
Using Titanium.Network.addConnectivityListener
Is this how I would use the connectivity listener? ~~~ if (Titanium.Network.addConnectivityListener()) { //code I would use to do something if connected to internet } else { //code for not connected to internet } ~~~ Thanks for the help.
Pulling reference objects from event listeners
We have a number of buttons, defined like this: ~~~ var i = <some sort of ID> var button = Titanium.UI.createButton( { text : 'X', data : i }); ~~~ In the click event listener for this button, how do we get the value of the 'data' parameter? We...
Tableview singletap doesnt fire if nothing in table
When the table is empty a singletap does not trigger a listener event. Is there a special property of tableview that does about the same?
Current window closes if i add event listener to MapView
I updated to titanium sdk 1.5.0 today. After the installation adding an event listener (even if it does nothing, see below) to a MapView doesn't work anymore. The current window containing the map view closes if I click on an annotation for example. If...
Label Click Event Listener Problem
Hey Guys I have a slight issue that is really bugging me, I am creating a load of Labels on the fly based on the results of a JSON query (Contained in a For Loop). I have an event listener that sits outside the For Loop, this then goes to a different...
in-object communication issue
Hello, I created a object containing also a button with an event listener. ~~~ function winAddUser() { this.infoVar = '122'; this.bExistingUser = Titanium.UI.createButton({ height: 55, width:...
Two listeners triggered at the same time, removeEventListener doesn't work
Hey, I have a listener attached to the row and the row has an icon which has another listener, why the row listener is triggered when I click over the icon? removeEventListener doesn't work. This is the code: http://pastie.org/1157225 Any help? Thanks.
URL Link Map Annotation (Iphone)
Hi there, I have created an app which was fully functional and live on the app store until the IOS4 release which made the map feature stop functioning. I originally built it in 0.8.1 but decided to rebuild in titanium 3.1.2 so i could use the IOS4 patch...
Switches won't fire.
Ok so I need to dynamically generate UI controls. (I won't be sure how many controls I need - it's being determined based on a data table) Each control needs a unique name so I can create a specific event handler. I got this accomplished by looping...
Target property undefined from ImageView click event
I have an event listener assigned to multiple imageView objects in a Window. I am unable to reference the imageView object thru the function fired on the 'click' event. I can get the e.type just fine, but I need to be able to reference the object...
Geolocation.addEventListener fires too often/repeatedly
I thought the geo event listener was supposed to fire when the location changed. I'm showing it fires hundreds of times a minute when the lat/long haven't changed. My code is straight from the Kitchen Sink. This has to affect battery life and overall app...
Listen to keyboard events
Is there a way to have listeners for keyboard events like "when return key pressed" or when "space key pressed"… It would allow me to send an xhr request before hiding the keyboard for a seamless user esperience
A matrix of dynamic imageViews, wich one was clicked?
For an image gallery I am trying to build a matrix of images from an array of image names by stepping through the array and creating an image View (of the same name) on every iteration. That works so far. I am too attaching an event listener on each...
Showing 1-50 of 54 1 2