0

Update View of snippet not being called in Visio TV

Hi,

I have been testing a widget on LG and Visio TVs. I find that when we open up a sidebar, close it and open the dock again, the updateView() method of the snippet is being called on LG TV whereas it is not being called on Visio TV. Is there a way to resolve this?

Thanks,
Icarus

by
3 Replies
  • QUOTE (Icarus @ Mar 3 2011, 10:29 PM) <{POST_SNAPBACK}>
    Hi,

    I have been testing a widget on LG and Visio TVs. I find that when we open up a sidebar, close it and open the dock again, the updateView() method of the snippet is being called on LG TV whereas it is not being called on Visio TV.

    Thanks,
    Icarus

    The Vizio behavior is the correct behavior.

    Once a snippet view receives an onShowView event from the dock (which triggers the updateView() method), it will never again receive that event unless the widget is unloaded.

    The typical life of a snippet looks like this:

    CODE
    onLoadView
    onShowView
    onSelectView
    onUnselectView
    onSelectView
    onUnselectView

    onUnloadView


    The container version in the LG simulator is older to simulate the actual experience on an LG tv. The Vizio simulator will contain a more recent container where this has been fixed.
    0
  • QUOTE (Benjamin Toll @ Mar 4 2011, 03:02 PM) <{POST_SNAPBACK}>
    The Vizio behavior is the correct behavior.

    Once a snippet view receives an onShowView event from the dock (which triggers the updateView() method), it will never again receive that event unless the widget is unloaded.

    The typical life of a snippet looks like this:

    CODE
    onLoadView
    onShowView
    onSelectView
    onUnselectView
    onSelectView
    onUnselectView

    onUnloadView


    The container version in the LG simulator is older to simulate the actual experience on an LG tv. The Vizio simulator will contain a more recent container where this has been fixed.


    Thank you Benjamin.

    How can I handle these events? Apart from the updateView() that is automatically being called, is there any other way to subscribe to these events?

    Also, is there any event that will be called every time a snippet is brought to focus? What if I need to make a small change whenever a snippet was brought to focus?

    Thanks,
    Icarus
    0
  • QUOTE (Icarus @ Mar 6 2011, 10:10 PM) <{POST_SNAPBACK}>
    Thank you Benjamin.

    How can I handle these events? Apart from the updateView() that is automatically being called, is there any other way to subscribe to these events?

    Any of those events can be subscribed to by subscribing to the application class (see my example below).

    QUOTE (Icarus @ Mar 6 2011, 10:10 PM) <{POST_SNAPBACK}>
    Also, is there any event that will be called every time a snippet is brought to focus? What if I need to make a small change whenever a snippet was brought to focus?

    Thanks,
    Icarus

    The widget fires the focusView event whenever it receives focus. You could listen for that by defining a focusView listener in your view, just like you do with your updateView:

    CODE
    focusView: function () {
    //do stuff here;
    },

    updateView: function () {
    this.controls.grid.changeDataset(API.spotlight("spotlight").dataset);
    },


    But you probably want to listen for when the view is selected. You could put this in your init.js script:

    CODE
    (function (event) {
    //you can switch on the viewId by inspecting the payload;
    if (event.payload.viewId === "snippet-Main") {
    //you have a reference to the view in the event's payload;
    event.payload.view.controls.anchorImage.element.hOffset = 20;
    }
    }).subscribeTo(KONtx.application, "onSelectView");


    Hope that helps.
    0

Recent Posts

in Design / Interaction - Yahoo! TV Widgets