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....
Use namespace in event
Hi, I use namespace in declare event on markup language in alloy like this: **Home.xml:** ~~~ <Button id="orderButton" onClick="Home.onOrderClick"></Button> ~~~ **Home.js:** ~~~ var Home = {} Home.onOrderClick =...
Event controller in different .js when event is declared by XML
Hi guys! I have this situation: *index.xml*: ~~~ <Alloy> <Window> <Require id="iconGroupAlfa" src="iconGroupToken" /> <Require id="iconGroupBeta" src="iconGroupToken" /> <Require...
textfield cursor position(android)
I am trying to restrict input (to a valid currency format)in a textfield as when it is being typed. However, when I change the value: txtField.value = newValue;, the position of the cursor moves to the front of the String. Example: position before: [ ...
Complete list of clicksource in event for map view click
Hi there, does anyone have a complete list for clicksource values? So far I have: - title - pin - annotation - leftButton - rightButton Since the documentation does not explain all - as often - I wonder if there's more.
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?
Prevent firing of change event when switch value is modified programmatically
Hi everyone, I have a simple (?) question, for those who can help. I am writing an iPhone home automation app, that talks through sockets to a simple TCP/IP server. I'm using Titanium SDK 1.6 and iOS SDK 4.1. In the app, at runtime, I create a bunch of...
imageview image finish loading event
which event is fired when imageview finish the remote image loading ? i want to check the height and width of the image after it finish the loading from remote images.
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...
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...
Multiple click on row will fire event multiple times
We've a application that uses a list with items(rows). On every row/item there's a click event listener. When the row/item is clicked than an window is created and opened in the current tab (Titanium.UI.currentTab.open(window)). The problem is when...
Displaying Ads on events
Hello there, i need to know, if its possible show some images on android and iOS. I need to hook it on events like hanging call, SMS income, unlocking phone etc... and when it shows user needs to click on it to hide, is it possible and how? thx
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) ?...
Network change event fired twice for wifi
Hi, I'm currently developing an app for Android and iOS with Alloy which should do something after the device is connected to the internet. To do so I'm listening to the change event from Titanium.Network. Here is some example...
Android Calendar Events
I am trying to create calendar event in my Titanium App for Android Platform. For that I am using below code, It does't give any error also didn't create any calendar events and also I'm sure that I have selected calendar by ID Android version:...
Android adding event to calender problem
Hi Everyone, I have searched a lot and found the only solution of adding event to calender is through using the intent. I have used the following code to that: ~~~ addevent.addEventListener('click', function(){ var intent = Ti.Android.createIntent({...
Add event to calendar with native interface
Hi I'm trying to add events to the device's default calendar and works OK with Ti.Calendar but, how can I open the native interface in iOS and Android? Each platform has an interface designed to add events, allowing user to modify event details before...
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' }); ~~~
How can I fire an event, when Barcode/QR-Code is recognized?
Hey Community, I am using the Redlaser Module from Marketplace and I have a small problem. I don't really know, how to fire an event, when Redlaser recognizes in life mode a QR oder Barcode? At this time it only works, when the user taps on done after...
Titanium 3.1.0 GA Calender Event and Alert
Hi I want to create reminders. Documentation and examples are scare. Q&A searches results are 2 years ago before 3.1.0 GA support...
Runtime Error fireEventToParent
Hello, i have a tableView with this hierachy, tableView->tableViewRow->view->imageView. My view has a event, when i start the event i get this error [see...
Keybord Search button event
Hi I want to search functionality on the table view with pressing search button on the keyboard . I have added search bar on the table. search functionality is working fine . i want to search functionality on the search button(key) on the keyboard. I cant...
Android back button closes app only on actual device
I am developping a small application for android. Everything works fine on the emulator, but wen I install the app to my Galaxy Note 2, every time I press the back button the application exits. It also seems to run in the background aswell. All windows...
Android after call event
Hello guys! I want to make a small feedback box after I have setted up a call with the intent. Is there any event which I could catch?
Event gots Lost
~~~ /* * Add Header Banner Event */ this.header_banner.addEventListener('click', function(e) { // central.printObject(e); // alert("header_banner clicked"); if (e.x > 0 && e.x <= 50) { ...
Adding a Calender event in iPhone
I want to add an event created by user using app and it should add in calender in iPhone. The newly created event should alert 5 mins before the set time for the event.
Click Event get Fired after a very long time
I am working on a project having a screen with large number of views. Everything works fine but the problem is when I click on any view after first installation of app on the iPhone device, the event get fired after a very long time. Is there any solution...
ListView Click-Event: ListViewItem-Deselection
Hey there, I'm currently trying to port my current Project from the TableView to the ListView API. While i now know how to set templates and assign custom items, i'm facing problems while handling the click event "itemclick" of the ListView....
Best practices for creating and destroying resources
Hi people,I wonder if this example is correct about the memory usage, the events and the structure, and if this is a best practice about prevent to create garbage and consume resources without releasing. - Should I release each object I make? - Is it...
Simulate a CLICK event to the Window leftnavbutton
Hi I want to simulate a click event to the windows back button programtically.. I am using Ti.App.fireEvent(win.leftNavButton, {name:'click'}); but it doesn't work. Anything wrong with the statement?
Webview not fires event
Hi all, I'm testing a code to fire an event from web view (remote html). It's not working, but I don't see what's wrong. html: ~~~ function fireurlweb(url){ alert('aaa'); Ti.API.info('a url on the webview was clicked : '+e.u); alert('bob'); ...
Change the app badge when receiving a push notification in background
Hi all, I have a little problem here, I want to modify the app badge on my iphone titanium based application. I was able to do it when the app is focused (foreground), but when I do it in backgound ... it won't do it I do send in the json of the push...
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...
Android: Swipe event-listener causes scrollView not to fluidly scroll up / down.
I have a swipe event listener on my `main` window, this event has the following code: ~~~ if (e.direction === 'up' || e.direction === 'down') return true; if (e.direction === 'right' && $this.animated)...
Get reference to interacted item.
I'm using Appcelerator Titanium 3.0 Alloy. For simplicity lets say I have 2 buttons ButtonA and ButtonB defined in my view XML. When the user clicks on either button I want to set that buttons background color to black. I can accomplish this by setting...
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:...
Notification
hi, i am creating a app in which when a user selects options from the menu and sets a reminder for it.i want the reminder to set a notification or a alarm after after some particular days that i want to set in the program.(user will not have option to...
How I can get x-y current position at 'touchend' event?
Hi, I'm developing an application for ipad (via Ti 3.0). I have a view and added 'touchstart', 'touchmove' and 'touchend' events. I try to get page-x and page-y position of view. I can get x and y with e.x and e.y. But it gives me local x- local y...
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...
ACS Create Event fails with error "'null' is not an object (evaluating 'c.trim')"
- Application type: mobile - Titanium SDK: 2.1.2GA - Platform & version: iOS 5.0 - Device: iOS simulator - Host Operating System: OSX 10.6.8 - Titanium Studio: 2.1.2.201208301612 The following code used to create a new ACS Event worked earlier in...
Get event X and Y coordinates on iOS device
Hi i have a problem with getting coordinates of event. example code for iphone4 ~~~ emptyView = Ti.UI.createView({width:640, height:960, image:'images/empty.png'}) // empty.png is full transparent emptyView.addEventListener('singletap',...
View animation not working well with AddEventListener?
I am a newbie to appcelerator, By running this code, i am expecting it will keep switching the view, image1 -> image2 -> image1 -> image2 -> .... But when run it on ipad simulator, it only switch from image1-> image2 -> image1 then no...
The correct way to call a local function
I wonder if the way we design the function "call_search" inside this procedure is the correct way. Thanks a lot. note: "pv" is the main app namespace. ~~~ (function() { pv.ui =...
How to avoid call twice listener at the same time?
I use for loop generate 20 labels . ~~~ for (var i = 0; i < 20 ; i++) { var lb = Ti.UI.createLabel({ width : 320, height : 70, left : 0, top : 70 * i , touchEnabled : true }); lb.addEventListener("singletap",function(e){ if...
Include Ti.Blob as a parameter to a Ti.App.fireEvent-event
Is it possible and/or advisable to include a Ti.Blob (in my case an image) in a global event, like this: ~~~ Ti.App.fireEvent("myglobalevent", { Photo: myPhotoBlob }); ~~~ And then of course catch it in the listening function: ~~~ function...
Android back button event on TabGroup window?
I'm trying to catch the Android backbutton event for windows contained in a TabGroup, SDK 3.0.0GA. For example, I added `self.addEventListener('androidback')` and also for `android:back` inside BaseUIWindow.js inside Kitchen Sink 3.0. These events are not...
How to know if the app resumes from tapping a push notification?
Hi there I have a little problem with an app that has push notifications (a messaging type of app) so when the user taps on the notifications while the app is on background .. I have to detect which push notification he tapped and show him the propper...
Event change doesn't fire on dynamically populated Picker - Titanium SDK
I'm trying to create a custom Picker whose data is from a remote JSON. The problem is that it doesn't fire the 'change' event on the picker at the first time when I select a row from the picker, I have to close the picker and select a row from the picker...