突然无法从app-assistant调用Mojo.Controller.stageController.pushScene()

时间:2011-08-23 06:20:21

标签: javascript webos mojo

Here is how the code is.
function AppAssistant() {
    this.dbObj = new DatabaseAssistant();
    this.schemaObj = new SchemaAssistant();
    this.result = {};
}

AppAssistant.prototype.setup = function() {
}

AppAssistant.prototype.handleLaunch = function(launchParams) {
    if (gConfigDatabase.engine == "sqllite") {

    } else {

    }
}

AppAssistant.prototype.processResult = function() {    
}

AppAssistant.prototype.execMigrations = function(version) {    
}

// Database error handler
// If the db does not exists, it will generate set of tables
AppAssistant.prototype.errorHandler = function() {
    Mojo.Log.info("In app asst error handler.");
    if (gConfigDatabase.engine == "sqllite") {

        try {
// execute some queries to create tables and insert some values in the HTML Opendatabase.

            // Show disclaimer Page
            Mojo.Controller.stageController.pushScene('disclaimer');
        } catch (e) {
            Mojo.Log.error("In AppAssistant errorHandler : ", e);
        }
    } else {
        Mojo.Log.info("db8 part of app asst error handler");

        try {
    // execute operations to create kinds for db8 analogous to tables 
            Mojo.Controller.stageController.pushScene("disclaimer");
        } catch (e) {
            Mojo.Log.info("Error in db8 appAsst error handler", e);
        }
    }
}

AppAssistant.prototype.handleCommand = function(event) {
}

所有这些都是为了支持webll应用程序的sqllite和db8。我面临的问题是,当我将变量( gConfigDatabase )配置为 sqllite 时,中的Mojo.Controller.stageController.pushScene`方法errorHandler 功能有效。但是当我改变它以便使用 db8 引擎时,我得到一个错误,说明未定义的方法 pushScene 。有关调试或解决此问题的任何线索或提示吗?

0 个答案:

没有答案