0

disconnect state

When trying to get the code for the "disconnect state" to work I get
"Kontx.messages is returned as undefined"
Any suggestions?

by
17 Replies
  • QUOTE (Jaime @ Apr 10 2009, 11:20 AM) <{POST_SNAPBACK}>
    When trying to get the code for the "disconnect state" to work I get
    "Kontx.messages is returned as undefined"
    Any suggestions?


    Javascript is case-sensitive. The proper capitalization is KONtx.messages
    0
  • yes, i know that. that's not the issue. i have it correct in the code. but thanks for the suggestion.
    0
  • hey jeremy,
    can you take a look at our widget? you guys have it...i believe it's in the samsung Q&A now. it's fully functional--i just don't have the disconnect state and the "english only" state working. i've messed around with it quite a bit, actually, and i've had a few other folks here take a look at it. we just keep getting the same message "kontx.messages is returned as undefined."
    thanks!
    jaime
    (ours is the usa today widget)
    0
  • QUOTE (Jaime @ Apr 13 2009, 05:46 AM) <{POST_SNAPBACK}>
    hey jeremy,
    can you take a look at our widget? you guys have it...i believe it's in the samsung Q&A now. it's fully functional--i just don't have the disconnect state and the "english only" state working. i've messed around with it quite a bit, actually, and i've had a few other folks here take a look at it. we just keep getting the same message "kontx.messages is returned as undefined."
    thanks!
    jaime
    (ours is the usa today widget)


    I'll ping Roger today and get a copy of your latest code.

    -Jeremy
    0
  • thank you!!!
    0
  • QUOTE (Jaime @ Apr 13 2009, 12:14 PM) <{POST_SNAPBACK}>
    thank you!!!


    I'm looking at this file:

    com.usatoday.widget.connected.tv.sports.540.1.2.zip.3.27.09

    And I can't see where that error would occur. Can you give me more insight? Your news_api.js doesn't include any calls to set noNetwork when the request fails.
    0
  • It got to the point where we were moving the code around to different places to test if it would work....we have the "EventHandlers.noNetworkHandler.subscribeTo(KONtx.messages, KONtx.messages.eventType, EventHandlers);" call in main.js (if it's commented out in the version you have...that's just because we just zipped it up as it was after many hours of frustration)
    we're calling "var EventHandlers" in the eventhandler.js file.
    the logs (in the eventhandlers.js and sectionMenu.js) are returning the error.

    does this help?
    0
  • QUOTE (Jaime @ Apr 14 2009, 09:41 AM) <{POST_SNAPBACK}>
    It got to the point where we were moving the code around to different places to test if it would work....we have the "EventHandlers.noNetworkHandler.subscribeTo(KONtx.messages, KONtx.messages.eventType, EventHandlers);" call in main.js (if it's commented out in the version you have...that's just because we just zipped it up as it was after many hours of frustration)
    we're calling "var EventHandlers" in the eventhandler.js file.
    the logs (in the eventhandlers.js and sectionMenu.js) are returning the error.

    does this help?


    Oh man! My apologies. I should have seen this problem right off, but sadly I didn't notice it until I looked in sectionMenu.js. The problem is that you are using Framework 0.2.2. We didn't add support for the Message Center (aka KONtx.messages) until Framework 1.1. I would highly recommend you upgrade as soon as conveniently possible as it would massively improve your development process.

    -Jeremy
    0
  • we actually (at one point in all of our trials) called in 1.1 specifically, and it didn't work.
    in upgrading to 1.1, what else do we need to change in our widget?
    0
  • QUOTE (Jaime @ Apr 14 2009, 11:29 AM) <{POST_SNAPBACK}>
    we actually (at one point in all of our trials) called in 1.1 specifically, and it didn't work.
    in upgrading to 1.1, what else do we need to change in our widget?


    Specifically you need to change the way your views are structured. In a short nutshell, the biggest changes are the following:

    Switch your application loading from this:

    CODE
    var $app = new KONtx.application.Manager({
    sources: {
    /* array of various source types */
    }
    });


    to this:

    CODE
    KONtx.application.init({
    views: [
    /* array of view declarations */
    ]
    defaultViewId: 'viewId_of_Default_aka_MainView',
    settingsViewId: 'viewId_of_your_settings_view'
    });


    and then restructure your views from this:

    CODE
    (function (){
    var view = $app.getCurrentView();

    view.onShow.subscribe(function () {
    viewBuilder( this.body.panel );
    })
    })();

    function viewBuilder(container) {
    /* code to build view */
    }


    To this style:

    CODE
    var MyMainView = new KONtx.class({
    ClassName: 'MyMainView',

    Extends: KONtx.system.SidebarView,

    initView: function() {
    // any code you need to happen when the view is first constructed. Consider this to be your class initializer
    },

    createView: function() {
    // any code you need to create the view. this is where the viewBuilder() code from above would live
    // instead of using this.body.panel as your container, the default container is now 'this'
    },

    updateView: function() {
    // use this for changing the screen when a user comes back to the same view again
    }
    });


    The majority of our widgets (except Weather and Flickr) are moved over at this point, so you could use them as examples as needed. In general, the Finance, News, and YahooVideo widgets are the most up to date, but that isn't universally the case ( I could also be saying that just because I wrote them, so maybe I am just biased :P ).
    0
  • Thanks, Jeremy.
    I'll give it a go and keep you posted. I'll most likely have questions along the way.
    Jaime
    0
  • QUOTE (Jaime @ Apr 14 2009, 12:31 PM) <{POST_SNAPBACK}>
    Thanks, Jeremy.
    I'll give it a go and keep you posted. I'll most likely have questions along the way.
    Jaime


    I do my best to update the forums 3-4 times a day, but if ever my response isn't fast enough shoot me an email and I can send you IM contact info.

    -Jeremy
    0
  • thank you so much! i've actually been asking for help on this for a few weeks now, so i'm tremendously appreciative. it would be an absolute shame if our widget doesn't make it into the gallery because of this disconnect state and the language state (both use the same code).
    so, again, thanks! i'll be working on it today and i'll be in touch!!
    jaime
    0
  • QUOTE (Jaime @ Apr 15 2009, 05:10 AM) <{POST_SNAPBACK}>
    thank you so much! i've actually been asking for help on this for a few weeks now, so i'm tremendously appreciative. it would be an absolute shame if our widget doesn't make it into the gallery because of this disconnect state and the language state (both use the same code).
    so, again, thanks! i'll be working on it today and i'll be in touch!!
    jaime


    Perfect! I am definitely here to help if you need me.

    -Jeremy
    0
  • Is there somewhere in the 0.2.2 framework that we can check for the country code changing? I realize that the proper answer is to use the 1.1 framework but putting that aside is there a way to do that in 0.2.2? I see in the 1.1 code there's this method:

    function _getCountryCode() {
    KONtx_automation_log("function","KONtx.application","_getCountryCode");
    if(platform && platform.yahooSettings && platform.yahooSettings.get && platform.yahooSettings.get.call) {
    return platform.yahooSettings.get('countryCode');
    } else {
    return null;
    }
    }

    Is there anywhere in 0.2.2 that platform.yahooSettings can be called as well?
    0
  • QUOTE (Jaime @ Apr 20 2009, 05:24 AM) <{POST_SNAPBACK}>
    Is there somewhere in the 0.2.2 framework that we can check for the country code changing? I realize that the proper answer is to use the 1.1 framework but putting that aside is there a way to do that in 0.2.2? I see in the 1.1 code there's this method:

    <snip>

    Is there anywhere in 0.2.2 that platform.yahooSettings can be called as well?


    Unfortunately that isn't callable by a normal widget (aka non-Yahoo! widget). We are working on a solution now and I will update you once it's in place (could be a few weeks).

    -Jeremy
    0
  • QUOTE (Jaime @ Apr 20 2009, 05:24 AM) <{POST_SNAPBACK}>
    Is there somewhere in the 0.2.2 framework that we can check for the country code changing? I realize that the proper answer is to use the 1.1 framework but putting that aside is there a way to do that in 0.2.2? I see in the 1.1 code there's this method:

    function _getCountryCode() {
    KONtx_automation_log("function","KONtx.application","_getCountryCode");
    if(platform && platform.yahooSettings && platform.yahooSettings.get && platform.yahooSettings.get.call) {
    return platform.yahooSettings.get('countryCode');
    } else {
    return null;
    }
    }

    Is there anywhere in 0.2.2 that platform.yahooSettings can be called as well?


    Also, one small nitpick, but please open a new forum post for new questions. Makes it much easier for others who also have similar issues to find the answer.

    Thanks!

    -Jeremy
    0

Recent Posts

in General - Yahoo! TV Widgets