Forging-Titanium icon indicating copy to clipboard operation
Forging-Titanium copied to clipboard

ep-002 crashes on android. TestWindow.js line 3 and line 15.

Open aokolovskis opened this issue 12 years ago • 1 comments

Hi, the demo crashes, because there is an error

line 3 controller is not found. i quess it should be the navController.

line 15 TestWindow is not found... well to solve this you can give the declaration function a name like Like Window and constuct it, using new window.

exports.TestWindow = function Window(navController) {  //named function Window
    var win = Ti.UI.createWindow({
        title:'Window '+navController.windowStack.length, //used the param instead of global
        backgroundColor:'#fff',
        layout:'vertical'
    });

    var add = Ti.UI.createButton({
        title:'Add A New Window',
        height:'50dp',
        width:'200dp',
        top:'20dp'
    });
    add.addEventListener('click', function() {
        navController.open(new Window(navController));  //call named constructor
    });
.....

Now it works fine on Android and iOS.

Regards Aleksejs Okolovskis

aokolovskis avatar Mar 01 '12 18:03 aokolovskis

+1 This fixed the demo for me.

visoft avatar Mar 27 '12 02:03 visoft