Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Widget EventListener

$
0
0

I'm using the com.appcelerator.login widget. I'm creating it in the index.js controller. I would like to be able to access the widget's event listeners so I can tell when the window (which widget creates) closes. Scenario: App opens, if user not logged in the opens the login widget, after login the widget (window) closes, app then opens navigation controller.

Problem: "undefined [loginWindow] is not a function...."

index.js

//index. js
 
$.loginWindow = Alloy.createWidget('com.appcelerator.login');
 
$.loginWindow.addEventListener('open', function() {
    if (OS_ANDROID) {
        $.loginWindow.activity.actionBar.hide();
    }else{
        setTimeout(function(){
            alert('works here too...');
        },5000);
 
    }
});

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>