1
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) {
}

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

4

0 回答 0