Change defaultViewId of application

Hi all,

Is there any way to change defaultViewId of application?

My problem is:
At the first time go to widget, it will show the screen 1,
and after 10seconds, it will load the screen 2.

And then, if you select the HOME button, it must show the screen 2.
But because i set defaultViewId: the screen 1, it always shows the screen 1.

I think i must set defaultViewId: the screen 2 after unload the screen 1.

Please help me if you know.

Jerry ^ _ ^

1 Reply
  • The right way to do this is to always set defaultViewId to be the id of view2. Then inside your snippet code, do the following:

            initView: function() {
    this._handleActivateSnippet.subscribeTo(this, ['onActivateSnippet'], this);

    _handleActivateSnippet: function(event) {
    if(view1_has_been_seen) {
    // let default happen, which is to go to view2
    } else {
    KONtx.application.setHostResultToViewId(event, "id of view1");

    The above code decides somehow if view1 has been seen, if so, just go to the default of view2, otherwise prevent the default and go where we say to (aka the id of view1).

    Then inside view1, I would probably switch views to view2 like this:


    The benefit of that line above is that the user won't have view1 in their history and the history will be fresh as of the load to view2.


Recent Posts

in General - Yahoo! TV Widgets