it("Controller opened via openScreen() should have a window", function () { var controller = App.openScreen("main"); if(!controller.window) { throw new Error(); } });
it("Opens a controller via an Alloy controller object", function () { var controller = Alloy.createController("main"); if(!App.openScreen(controller)) { throw new Error(); } });
/* Click Event listener of table to select an item * Check if there is a method to update the text (in case of tablet), * else case will be used for handheld devices as new screen is opened on every product selection. * */ function selectItem(e) { if (args.updateText) { args.updateText({ name : e.rowData.title, price : e.rowData.price }); } else { App.openScreen('common/DetailView', { title : 'Product Details', navGroup : $.navGroup || null, name : e.rowData.title, price : e.rowData.price }); } }
/** * @class Controllers */ // App bootstrap var App = require("core"); App.init(); App.openScreen("main");
/** * @class Controllers */ // App bootstrap var App = require("core"); // Save UI windows to global App.NavGroup = $.NavGroup; App.Window = $.Window; // Start application App.init(); // Open the initial window App.openScreen("main", { title: "Main Screen", goBack: false });
it("Opens a controller via a string", function () { if(!App.openScreen("main")) { throw new Error(); } });