Community Questions & Answers
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...
Error when creating a Titanium.App Listener
Hi, I am trying to define a Global EventListener to fire using FireEvent. But I am having some trouble in making it to work, don't know why but the same code work on KitchenSink but not on my App. What am I doing Wrong? Here is the error I am...
What is fireEvent? How do I use it?
Hi guys, I do not understand how to use fireEvent aside from `Titanium.App.fireEvent('someEvent')`. The docs show fireEvent as a method in most (if not all) modules. I tried to do this and I got an error. If fireEvent is called inside another event...
Triggering fireEvent from WebView's html.
Hey guys! **[This is on the iPhone]** I've been trying to trigger this function: ~~~ Ti.App.fireEvent('openLink', {url:"'+_myUrl+'"}); ~~~ From inside my html. Here's how it looks: ~~~ <javascript Titanium code> ... //Inline HTML...
Titanium.App.fireEvent(...) works in directly-loaded local HTML but not in indirectly loaded local HTML
Load a local HTML file (first.html) into a webview. A link in this html loads another local HTML file (second.html). This second.html issues Titanium.App.fireEvent(...) but it doesn't work. The same works if I load second.html directly into the webview. ...
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...
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...
Ti is not defined when Ti.App.fireEvent in webview
That's all the information I can give you guys. I can't access titanium or Ti from webview. When I run in on the desktop it keeps saying: Uncaught ReferenceError: Ti is not defined Am I missing an include or something?
webView dynamic html fireEvent wont work
I'm LOSING MY MIND!!!! Im creating a webview from html that is generated. On each of the images i want to attach a onClick which will fire a Ti.App.fireEvent. But it doesn't work, I can call alert(3); that works but as soon as i try to talk to my app...
Why Titanium.App.fireEvent doesn't work inside html on a mobile web aplication?
I have a project for mobile web created with Titanium 3.0.2. The application has a header with a webview, and the content with a tableview. On app.js I have the next lines for catching the event named...
Image from PhotoGallery to another window
So I'm trying to pass an image from the app.js to a different .js file So in app.js I nicely open the photogallery picker, choose a photo. ~~~ var image = event.media; If succes I will use Ti.App.fireEvent(''customName", image); ~~~ then in the...
fire event won't work on ios
hello, i'm facing a problem using app level events on ios, when i fire an event passing through a complex object like a view from a module to another, on listener side the object result undefined, so for instance if a create a view and pass it to the fire...
How do you make an object subscribe to another object events?
I am working with an alloy project. Titanium SDK 3, running on Mac OSX. IOS / Android targeted app. Here is the thing. I want an object to react to another object events but I don't know how to make them listen / subscribe to them. In my case I have a...
Fire Event from Urban Airship Inbox like webview
Is it possible to fire an event from a urban airship rich push notification? I am using the Urban Airship Module from the marketplace, Ti sdk 3, ios 6 I tried adding: <a onclick="Ti.App.fireEvent('app:displayProfile', {profileId:...
webview fireEvent
hello, i've to bring up an issue mentioned here several times, but which is not answered yet. it seems that a custom event defined in a webview fire at least 2 times. that's nasty e.g. in case you create a window or view based on the event. is there a way...
can't get fireEvent data from web view
I know there's a billion posts about this but can't seem to get anywhere with my particular problem. Pretty straight forward...thx!! app.js ~~~ Ti.UI.setBackgroundColor('#000'); var win = Ti.UI.createWindow(); var web = Ti.UI.createWebView({ url :...
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() {...
FireEvent Facebook Login Button
Hi every body i tried to fire facebook login button using fire event like below but it seem doesn't working !! any idea !?? ~~~ var logInFacebook = Titanium.Facebook.createLoginButton({ visible :...
WebView fireEvent from remote web page?
I'm trying to establish communication between items in a WebView and my main code. I'm able to use Ti.App.fireEvent from html pages that are hosted on the phone (are part of the app), but when I do the same from a remote URL (an html page not hosted on the...
fireEvent through remote webview possible in SDK 2.1.3?
So I've spent the past 4 hours trying every possible way to fire an event through a remote web page in a webView, but I would like to know if it's even possible. There are so many mixed comments online saying you can, you can't, you can but it has to be a...
Ti.App.fireEvent / webView / api 1.6 issue
hello, i'm just testing older projects against api 1.6. it seems that custom events fired from a webview don't get through. this code [http://pastie.org/1645318](http://pastie.org/1645318) works as expected on 1.5.1 and before, but not on 1.6. any idea...
Fighting with Titanium framework and a bit frustrated: why Titanium's own objects undefined?
Hi Titanium Developers, Titanium looked fine but I've been fighting with the framework for 2 days and I'm now a bit frustrated. Why did Titanium behave DIFFERENT in the simulator and the device? What the most get me down was that NO clue for such...
FireEvent - Cyclic Object - Bug
Does anyone experience the, same problem ? When i try to fire a custom event and the data contains an cyclic Object the Application just crashes ? app.js testcase: ~~~ var win = Ti.UI.createWindow({ title:"Cyclic Event" }) var button =...
Calling Ti.App.fireEvent from External JS file
Hi In WebView I call Ti.App.fireEvent in an external JS file in a function that itself is a function method. It is not being called if **Ti.App.fireEvent** written in external JS file. It is not being called on onclick either which is defined on a SPAN...
Losing EventListener when authenticating to Instagram
Hey everyone! A big thank you for anyone who can help me out today. I've set up an eventListener in app.js and a fireEvent within my webView index.html. When I launch the app and click the button, the event is fired as it should. However, when the user...
how to send UIButton On Module
In Module. ~~~ -(void)selectPhoto:(UIButton *)button { NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys: button, ...
App level event listener with arguments
How would I pass arguments to the sayHello function below? ~~~ function SayHello(data) { alert(data); } //setup event listener Ti.App.addEventListener ('test', sayHello); //fire the event, send data Ti.App.fireEvent('test',data); ~~~
call function within function commonjs
If I have a function inside of an "exports" function, can I call that function from another commonJS module? ex below ~~~ //this is table.js exports.TableWindow = function(){ //create base window var self =...
Ti.App.fireEvent very slow, are there any recomandations how to speed this up?
I am using almost often in my app some custom events for refreshing some screens, tables, labels etc.. for making the navigation, etc... I couldn't help notice that passing internal messages in the app is very slow... In the emulator it you can't notice...
webView usage guideline
hello, i'm trying to figure out possible use of a (android) webview. i've read through the various Q&A, but it seems there's some confusion, therefore i ask a dedicated more general question. particularly i'm interested in creating a webview from a...
Fire Event execute multiple time.
Hi,I am developing android application with Titanium, android sdk 1.8.0.1.In my application there are three tabs.Every Time when I click on tab my window get refreshed.So my code structure looks like: ~~~ ////// m.js ///////////////// var explore =...
fireEvent fires an API calls more than once
I have a listing page which list all the data I pull from backend API. The window has a focus event. ListingWin.addEventListener('focus', function() { // my listing code here. }); When I click on a row, it takes to another window(editWin) to edit the...
Extract URL from a local HTML file
I am opening a local html file in the app. Within the html page, i am running javascript that opens an ad. I need to extract that ad link and use it to create a `Ti.App.fireEvent('openURL', {url: 'MYLINK'});` The link is stored in the "href"
Firing evnt from module
Hi, in a module I fire an event an send a dictionary: ~~~ tableview.addEventListener('click', function() { control.getDRouten(function(_e) { var rows = require('/modules/getdrouten').create(_e); Ti.App.fireEvent('set:submenue', { "rows" :...
how work Ti.Map.Annotation.fireEvent ?
Hello everyone, Im trying to use an fireEvent to an Annotation from a Map. i Try to use `mapview.annotations[0].fireEvent('click'); ` but doesn't work, i need to show the data of the pin on the screen, the same information when you cick a pin.
Is there a way to pass custom values in between Ti.App.fireEvent?
titanium mobile sdk 2.1 iphone sdk 5.1 Hi, Is there a way to pass a custom value from 'Ti.App.fireEvent' to 'Ti.App.addEventListener'? I tried this but didn't work: ~~~ Ti.App.fireEvent('changebg',...
Forced appearing of keyboard
Hi, I want to show keyboard after butoon clicking: ~~~ var button = Ti.UI.createButton({ title : 'Send us a photo!', }); textfield.addEventListener('blur', function() { toolbar.hide(); // this works fine }); button.addEventListener('click',...
Issues using WebView for a remote web application
We are building a proof of concept using Titanium to wrap an existing web application but have two specific issues: 1. We are unable to use fireEvent within the web application to push events up to the Titanium application. Our web application has a number...
fireEvent in iOS module don't calls defined function
I try to fill a webview in titanium using stored data in a iOS module, but when I try to call "fireEvent" my function reference in app.js just don't get called and the app closes itself with "[INFO] Application has exited from...
cant get fireEvent to work with webview
I am trying to work with gRaphael for pie charts, but I am struggling to get a fireEvent to work. Below is app.js ~~~ function pieChart(dataArray){ //create webview with piechart.html var raphwebview = Titanium.UI.createWebView({ width: 320, ...
WebView fireEvent message size limit
I have found that it is not possible to send data more than around 4-5Kb via Ti.App.fireEvent to a webview - the system just seems to hang if you try to send more. Question - how do I send larger volumes of data from Titanium to a webview.
Can module fire an event?
Hi, this code: ~~~ var myobject = require('mymodul').create(parameters); myobject.addEventListener('myevent',dosomething); ~~~ How can I fire an event from inside? ~~~ exports.create = function() { return myview; } ~~~
Running JS in a webView and triggering a fireEvent in version 2.0
All this used to work fine on both iOS and Android pre-2.0 Ti SDK. Here is a simple example app.js to test loading some HTML and JS in to a webView including some links to trigger some simple JavaScript functions and also test firing an event back to the...
fireEvent / addEventListener do not work for arbitrary objects?
If I fire my custom event with the following code: ~~~ Ti.API.fireEvent('foo', {bar:'baz'}); ~~~ Then the only way to catch it is to use: ~~~ Ti.App.addEventListener('foo', function(e) { /* this will work */ }); ~~~ If i try to do this on an...
communicate between two windows with anonymous functions
Hi. I have two anonymous functions. From the first function I invoke an event that is in the second function, with a fireEvent. I open a new window that says "Click from win1". Without using Ti.App... how can I do to communicate the new window...
FireEvent Not Working On iPhone When Loading Pages
I have a small web document that I am 'wrapping' in Titanium and releasing on iPhone and Android. It needs to play some sounds so I am using a bit of code to fire an event and trigger the audio playback (I want it to work on Android 2.2 so can't use HTML5...
fireEvent from webview not working on ipad/iphone device
Hi, I really need help on this as i feel really stuck. I have a webview that uses Ti.App.fireEvent in its scripts. It works really well on simulator (even if sometime i loose them until clean build). My problem is that they dont work at all on device! I...
Ti.API.firevent vs Ti.App.fireevent?
With iPhone I can setup an event handler and a fireevent under Ti.API, however Android will not fire it. If I change the handler and the fireevent to Ti.App, Android will fire it, however iPhone declares the input value of tab...
Android - Webview & Fireevent.
I have looked at many examples of how to to this in the forums. None of these work. The push/pop method of the titanium queue works on iOS but not Android. Is there absolutely NO way for the web view to communicate back to titanium with events?
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...