开发者

Calling setupWidget from the stage assistant in WebOS/Mojo

The scroller and other widgets in Palm's WebOS are commonly called like so:

this.controller.setupWidget(Mojo.Menu.appMenu, {}, this.appMenuModel); 

within on of the JavaScript assistant files representing a 'scene'.

My application is dead simple and requires only one view, so I'm not using anything other than the stage-assistant file and an index.html file that contains links to various other JS and CSS files. Trying to call setupWidget like this results in an error (Uncaught TypeErr开发者_运维百科or: Cannot call method 'setupWidget' of object):

StageAssistant.prototype.setup = function () {
    this.controller.setupWidget("widgetId",{},{});
}

In a sentence, I want to be able to initiate a Mojo HTML scroller widget from the stage assistant file.


The problem is there's no setupWidget method on the StageController class. You've got to have one scene or there's nothing to show on the stage. The whole Mojo widget system depends on this Stage/Scene hierarchy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜