突然无法从应用程序助手调用 Mojo.Controller.stageController.pushScene()

发布于 2024-12-01 10:20:26 字数 1741 浏览 1 评论 0原文

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时,则 中的 Mojo.Controller.stageController.pushScene` 方法errorHandler 函数有效。但是当我更改它以便使用db8引擎时,我收到一条错误消息,指出未定义方法pushScene。有关调试或解决此问题的任何线索或提示吗?

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

All this was done to support both sqllite and db8 for an webOS app. The problem i am facing is that when i configure a variable (gConfigDatabase) as sqllite then the Mojo.Controller.stageController.pushScene` method which is there in the errorHandler function works. but when i change it so that db8 engine is used, then i get an error saying undefined method pushScene. Any clues or hints on debugging or solving this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文