1

Creating views in init.js

I was wondering if anyone could point me to an example of how to create a view in init.js - I'm not completely understanding how to do this, and I'm not seeing any examples in the documentation.

I currently have this:

CODE
KONtx.application.init({
views: [
{ id: 'view-Main', viewClass: MenuView,
data: { link: $options.bootstrap_url,
guid: '_bootstrap_0', // need a sentinel value here.
showBackButton: false,
style: $options.bootstrapMenuStyle != undefined ? $options.bootstrapMenuStyle : $options.defaultMenuStyle
}
},
{ id: 'view-Menu', viewClass: MenuView },
{ id: 'view-Item', viewClass: ItemView },
{ id: 'view-Settings', viewClass: AboutView },
{ id: 'view-VideoPlayer', viewClass: VideoPlayerView },
{ id: 'snippet-main', viewClass: SnippetView },
],
defaultViewId: 'view-Main',
settingsViewId: 'view-Settings',
});


I had previously thought that code would create the views but it seems my understanding was incorrect.

by
25 Replies
  • To clarify a bit more:

    The problem is that every time a view is called, it creates a new view object and then populates it. This is causing the widget to run out of memory after being used for a little while. What I'm trying to accomplish is to have the views created only once each, and then only FILL it, rather than creating a new view object each time.
    0
  • QUOTE (Tony Garcia @ Jun 30 2011, 01:40 PM) <{POST_SNAPBACK}>
    To clarify a bit more:

    The problem is that every time a view is called, it creates a new view object and then populates it. This is causing the widget to run out of memory after being used for a little while. What I'm trying to accomplish is to have the views created only once each, and then only FILL it, rather than creating a new view object each time.


    The widget is probably adding dynamic views for each item which causes memory issues.
    Define the required types of views up-front in init.js and then fill them with data by loading them only when required.

    Try starting with the sample views provided in the quick start guide here:

    http://developer.yahoo.com/connectedtv/qui...TV_Widget_Views

    See the example for updateView():

    http://developer.yahoo.com/connectedtv/qui...reen_View_Class


    or the other examples in the samples directory.

    http://developer.yahoo.com/connectedtv/qui...pment_Directory
    0
  • QUOTE (TVWidgetDocs @ Jun 30 2011, 06:29 PM) <{POST_SNAPBACK}>
    The widget is probably adding dynamic views for each item which causes memory issues.
    Define the required types of views up-front in init.js and then fill them with data by loading them only when required.


    Yes, that is what is happening. And I understand WHAT you're saying to do. What I'm missing is HOW.

    Looking at the samples, I don't see what I'm doing differently. (Not saying it's not there, but if it is, I can't see it) The code I posted seems to follow the pattern I see in all other init.js files - so where is the view created? Or, alternately, can you help me understand how a DYNAMIC view is created, and I can look for that in my code?
    0
  • QUOTE (Tony Garcia @ Jul 1 2011, 07:19 AM) <{POST_SNAPBACK}>
    Yes, that is what is happening. And I understand WHAT you're saying to do. What I'm missing is HOW.

    Looking at the samples, I don't see what I'm doing differently. (Not saying it's not there, but if it is, I can't see it) The code I posted seems to follow the pattern I see in all other init.js files - so where is the view created? Or, alternately, can you help me understand how a DYNAMIC view is created, and I can look for that in my code?


    The code snippet you posted from init.js looks fine, but I would want to look for any extra calls to KONtx.application.addViewConfig in your code, which will dynamically add a new view everytime it is called. Look for such calls in your code.
    0
  • QUOTE (Vivek Jani @ Jul 4 2011, 05:25 AM) <{POST_SNAPBACK}>
    The code snippet you posted from init.js looks fine, but I would want to look for any extra calls to KONtx.application.addViewConfig in your code, which will dynamically add a new view everytime it is called. Look for such calls in your code.


    Thanks - that definitely helped.

    But now I'm running into another problem (and I think I see why the original code was written the way it was):

    I have menus under menus, and if I get rid of the code creating new views, they all end up using the 'view-Menu' ID. But when I try to load it, I get the error "You can't switch to a view you are already on".

    I'm looking at the API documentation but I can't see a simple way to just change the data in a view and reload it - in fact, I'm not seeing a method for changing the data in a view at all. I'm sure it exists, but I'm just missing it. If I could do that, then I wouldn't have to worry about changing the views.

    Also, I'm pretty sure my 'fix' isn't all that great, since it still calls addViewConfig, just without changing the ID. Here is what I had:
    CODE
    var newViewID = 'view-Menu-' + this.my_item.guid;
    KONtx.application.addViewConfig({
    id: newViewID,
    viewClass: MenuView,
    data: this.my_item
    });
    KONtx.application.loadView(newViewID);


    I tried changing it to:
    CODE
    KONtx.application.loadView(
    'view-Menu',
    {data: this.my_item}
    );


    - but that wouldn't do anything at all. I changed it to:
    CODE
    var newViewID = 'view-Menu';
    KONtx.application.addViewConfig({
    id: newViewID,
    viewClass: MenuView,
    data: this.my_item
    });
    KONtx.application.loadView(newViewID);


    - that loads the view first time around but not when I try to go to a sub-menu. And I'm not sure it would fix the memory problem even if it did load the sub-menus.

    So what I WANT to do here is when I select a menu, it will load the menu view, then when I select a sub-menu, it updates the data in the menu view to the new info and then displays that - I suppose that would be without actually CHANGING views, only re-displaying the current...

    I know I'm probably missing something really basic, but I've been looking over the documentation and I'm really just not seeing what I'm missing - sorry to be asking such basic questions! (I'm still trying to puzzle this out on my own, but your help is appreciated)
    0
  • BTW, I'm looking at the updateView example, but it deals with mediaplayer views, which is messing me up some on translating to a regular view.

    Again, sorry to be so dense!
    1
  • Hmm - this discussion seems relevant:
    http://developer.yahoo.net/forum/?showtopic=4090

    jeremy.johnstone suggested this in post #10:
    CODE
    KONtx.application.addViewConfig({ id: 'SubMenu-XX', viewClass: MyMenuViewClass, data: { menu: XX }});
    KONtx.application.loadView('SubMenu-XX');


    This is basically what's happening - the SubMenu-XX being replaced by a unique ID.
    BUT - this is what is causing the out of memory error.

    I've tried using KONtx.application.remove() but still get the error - it seems like not all views are getting removed.

    Are there any examples anywhere on how to create a dynamic menu/sub-menu system, based on XML being loaded at runtime?
    0
  • thanks.
    0
  • The thread you mentioned has a solution that you could try as well.

    QUOTE
    It sounds like what you want to be done can be done with a single view - but you're not going to be able to do this with loadView and reloadView.

    Instead what would work is just dynamically updating the grid dataset when people select something that takes them from category to sub-category. You can simply change the dataset or even recall the updateView function (or some other method you create).

    This will of course kill the back button. You'll likely have to maintain your own history stack and override the default back button behavior to allow people to go back within the categories.


    To add to this, if you expect the tree to be very deep or are uncertain about the depth, the history stack may not contain the entire dataset and just fetch that level's data again on going back. If you know its going to be not too deep and not much data at each level then you may maintain the dataset items at each level on the stack.

    Thanks,
    Vivek
    0
  • I kinda understand, but, again, I don't get HOW. I realize I'm probably missing the obvious - but how do you do this?

    QUOTE
    Instead what would work is just dynamically updating the grid dataset when people select something that takes them from category to sub-category. You can simply change the dataset or even recall the updateView function (or some other method you create).


    I just don't see how I take the data from where it is and just update the view with it (which was one of the options I was looking at).

    I realize that's probably a dumb question - but I'm trying to work with code written by someone else who hasn't been around for awhile, and I just seem unable to wrap my head around how this system functions & how the documentation works - I just can't find anything that tells me how to do what I'm trying to do (and what probably a lot of others have been able to figure out)...
    0
  • QUOTE (Tony Garcia @ Jul 5 2011, 01:29 PM) <{POST_SNAPBACK}>
    I kinda understand, but, again, I don't get HOW. I realize I'm probably missing the obvious - but how do you do this?



    I just don't see how I take the data from where it is and just update the view with it (which was one of the options I was looking at).

    I realize that's probably a dumb question - but I'm trying to work with code written by someone else who hasn't been around for awhile, and I just seem unable to wrap my head around how this system functions & how the documentation works - I just can't find anything that tells me how to do what I'm trying to do (and what probably a lot of others have been able to figure out)...


    OK, here is a sample implementation of a simple tree-like menu:

    CODEBOX
    /**
    * Represents a tree sort of view, which can be a collection of groups of feeds and
    * feed titles. It is parsed from the <outline> element in the OPML file.
    *
    * If the menu item is a feed title, the next view will show the feeds, if it is a group of feeds, then it will
    * show its children.
    *
    */
    $vnews.views.menuView = new KONtx.Class({

    ClassName: "MenuView",

    Extends: KONtx.system.SidebarView,

    createView: function() {


    this.controls.backButton = new KONtx.control.BackButton({
    label: $_("my_feeds"),
    events: {
    //Handle the back button for this view ourselves, since we
    //use the view as a tree with nth level nodes at any time.
    //Use a stack to keep track of which data to show when back-button is clicked.
    onSelect: this._backListener.bindTo(this)
    }
    }).appendTo(this);

    this.controls.titleText = new KONtx.element.Text({
    label: $_("my_feeds"),
    styles: {
    fontSize: 15,
    fontWeight: "bold",
    hOffset: 5,
    color: "white"
    },
    visible: false
    }).appendTo(this);

    this.controls.menuGridPageIndicator = new KONtx.control.PageIndicator({
    styles: {
    vOffset: this.height,
    vAlign: "bottom",
    width: this.width
    }
    }).appendTo(this);

    this.controls.menuGrid = new KONtx.control.Grid({
    id: "menuGrid",
    rows: 7,
    columns: 1,
    styles: {
    width: this.width,
    vOffset: this.controls.backButton.outerHeight,
    height: this.height - 20 - this.controls.backButton.outerHeight
    },
    cellCreator: this.cellCreator,
    cellUpdater: this.cellUpdater
    }).appendTo(this);

    this.controls.menuGrid.attachAccessories(this.controls.menuGridPageIndicator);
    },

    cellCreator: function() {

    var cell = new KONtx.control.GridCell({
    styles: {
    width: this.width
    },
    events: {
    //Just before going to the next level of nodes in the same view,
    //push the current dataset in the stack.
    onSelect: function(event) {
    log("cellllllllll:" + this.getCellDataIndex());
    var dataitem = this.getCellDataItem();
    var stack = KONtx.messages.fetch("menu-stack") || [];
    stack.push(this.getView().persist.results);
    KONtx.messages.store("menu-stack", stack);
    if (!$empty(dataitem.url)) {

    KONtx.application.loadView("vnews-list", dataitem);
    } else {
    //Reset the pager anytime we refresh the grid.
    this.getView().controls.menuGrid.changeDataset(dataitem.feeds, true);
    this.getView().persist.results = dataitem.feeds;

    this.getView()._showHideBackButton();
    this.getView().controls.backButton.setText(dataitem.title);
    }

    }
    }
    });

    cell.feedImage = new KONtx.element.Image({
    styles: {
    height: 30,
    width: 40,
    vOffset: 5
    }
    }).appendTo(cell);

    cell.feedTitle = new KONtx.element.Text({
    styles: {
    color: "white",
    fontFamily: "Helvetica Neue",
    fontSize: "16px",
    fontWeight: "bold",
    hOffset: 45,
    vOffset: 5,
    width: this.width - 45

    },
    truncation: "end",
    wrap: true
    }).appendTo(cell);

    return cell;
    },

    cellUpdater: function(cell, dataitem) {
    if (!$empty(dataitem.url)) {
    cell.feedImage.src = "Images/960x540/2Paper_48.png";
    } else {
    cell.feedImage.src = "Images/960x540/7bag_48.png";
    }
    cell.feedTitle.data = dataitem.title;
    },

    updateView: function() {

    if (this.backParams && this.backParams.comingBack) {
    var stack = KONtx.messages.fetch("menu-stack");
    this.persist.results = stack.pop();
    this.controls.menuGrid.changeDataset(this.persist.results, true);

    } else {
    this.controls.menuGrid.changeDataset([], true);
    //Call the backend API to fetch the opml file from the user-specified location.
    $vnews.api.fetchMyFeeds(this.myFeedsCallback.bindTo(this));

    }
    this._registerHandlers();
    this._showHideBackButton();

    },

    hideView: function() {
    this._unregisterHandlers();
    },

    myFeedsCallback: function(results) {
    //Update the grid with the results and store the results
    this.controls.menuGrid.changeDataset(results, true);
    this.persist.results = results;
    this.controls.menuGrid.focus({
    row: 0,
    column: 0
    })
    },

    _backListener: function(event) {
    //Handle the back button for this view ourselves, since we
    //use the view as a tree with nth level nodes at any time.
    //Use a stack to keep track of which data to show when back-button is clicked.
    var stack = KONtx.messages.fetch("menu-stack") || [];
    if (stack.length != 0) {
    this.persist.results = stack.pop();
    this.controls.menuGrid.changeDataset(this.persist.results, true);
    KONtx.messages.store("menu-stack", stack);
    this._showHideBackButton();
    this.controls.menuGrid.focus();

    }
    //Cancel this event since we have already handled it for this case.
    event.preventDefault();
    event.stopPropagation();

    },

    _registerHandlers: function() {
    if (this._boundBackListener) {
    this._unregisterHandlers();
    }
    this._boundBackListener = this._backListener.subscribeTo(KONtx.application, "onActivateBackButton", this);
    },

    _unregisterHandlers: function() {
    if (this._boundBackListener) {
    this._boundBackListener.unsubscribeFrom(KONtx.application, "onActivateBackButton");
    delete this._boundBackListener;
    }
    },

    _showHideBackButton: function() {
    var historyStack = KONtx.messages.fetch("menu-stack");
    if (!historyStack || historyStack.length == 0) {
    this.controls.backButton.visible = false;
    this.controls.titleText.visible = true;
    } else {
    this.controls.backButton.visible = true;
    this.controls.titleText.visible = false;
    }
    }
    });


    The data for this view consists of feed-groups and feeds and feed-groups are a collection of feeds. So, feed-groups can have children while feeds are leaf nodes. On clicking a feed-group, the view updates its grid with its children and preserves the back-button behavior. On clicking a feed, we go to the next view. Any tree-structured data may be used similarly.

    Note the methods updateView, _cellCreator's onSelect method and _backListener method. The parameters this.persist.backParams and this.persist.backParams.comingBack are passed from the next view to this view, while coming back( since we have a stack of back history maintained for this view, we need to pop the last one when coming back from the next view, so you need to implement this view's as well as next view's back button handler yourself and cancel the default event).

    Let me know if you have more questions.

    Thanks,
    Vivek
    0
  • QUOTE (Vivek Jani @ Jul 8 2011, 01:51 AM) <{POST_SNAPBACK}>
    OK, here is a sample implementation of a simple tree-like menu:
    ...
    Let me know if you have more questions.

    Thanks,
    Vivek


    Vivek, Thank you! That helps a lot - I'm sure I can work out the details for my widget from there.
    0
  • Well, it looks like I'm still having some problems.

    Specifically, I can't seem to load up the data in the new view. I keep getting the error "You can't switch to a view you are already on"

    I'm getting that error in the onSelect event handler:

    CODE
    onSelect: function(event) {
    log("\n**********\ncell:" + this.getCellDataIndex());
    var dataitem = this.getCellDataItem();
    var stack = KONtx.messages.fetch("menu-stack") || [];
    stack.push(this.getView().persist.results);
    KONtx.messages.store("menu-stack", stack);
    if (!$empty(dataitem.link)) {

    /* ERROR HAPPENS HERE */
    KONtx.application.loadView("view-Menu", dataitem);

    } else {
    //Reset the pager anytime we refresh the grid.
    this.getView().controls.menuGrid.changeDataset(dataitem.feeds, true);
    this.getView().persist.results = dataitem.feeds;
    this.getView()._showHideBackButton();
    this.getView().controls.backButton.setText(dataitem.title);
    }
    }


    This happens the first time I try to load a sub-menu - so I am able to load the top-level menu, but when I select one of them, I get that error, and it doesn't load. I'm not seeing anything that overrides loadView, which seems to be what's throwing the error - so how do I get the new data into the object to replace the old data?

    I see updateView, but it doesn't look like that does anything to get the data from the source.

    Just in case it's relevant, this.getCellDataIndex() is returning 0
    0
  • Just to jump on this bandwagon - we are seeing the same out of memory errors using this dynamic view idiom. It seems to actually happen if we move too quickly through the app in the simulator. If we pause between views it doesn't seem to happen as much.

    CODE
    KONtx.application.addViewConfig({ id: 'SubMenu-XX', viewClass: MyMenuViewClass, data: { menu: XX }});
    KONtx.application.loadView('SubMenu-XX');


    Is there some way to manage the memory when using the addViewConfig method? how many views are "too many"? We are adding about 20-30 views this way since it seems like an easier way to manage a view stack and this seems to cause problem after going through about 5-6 views quickly.
    0
  • This code snippet deals with leaf nodes/parent nodes as part of the if/else condition. If it is a leaf-node, I had another view defined to explore it and so I load that view with the data, whereas if it is a parent node, I simply get its children(i.e. dataitem.feeds) and replace the grid data in the current view. You can update the same view in both cases(depending on your use case). But you still seem to be trying to load the same view again which gives that error. Consider implementing the next view as a separate view. You seem to be mixing too many things in the same view. Please elaborate your use-case.

    Thanks,
    Vivek
    0
  • Don't use loadView. create a function to update the view and then replace the data. loadView should only be used when actually loading a view
    0
  • QUOTE (Devici @ Jul 12 2011, 10:36 AM) <{POST_SNAPBACK}>
    Don't use loadView. create a function to update the view and then replace the data. loadView should only be used when actually loading a view


    That's what I'm trying to figure out - how do I "update the view and then replace the data"?

    It's quite apparent that I'm missing something painfully obvious, but I don't see how to get my data (from the http call) into the view.


    Going back over everything - would that have something to do with this code section?
    CODE
    this.getView().controls.menuGrid.changeDataset(dataitem.feeds, true);
    this.getView().persist.results = dataitem.feeds;

    this.getView()._showHideBackButton();
    this.getView().controls.backButton.setText(dataitem.title);

    - changeDataset, in particular?

    I'm still just guessing - I've barely worked with the framework so I'm still learning my way around - but it seems like that might be doing what I need done. Am I on the right path with this?
    0
  • QUOTE (Tony Garcia @ Jul 12 2011, 01:30 PM) <{POST_SNAPBACK}>
    That's what I'm trying to figure out - how do I "update the view and then replace the data"?

    It's quite apparent that I'm missing something painfully obvious, but I don't see how to get my data (from the http call) into the view.


    Going back over everything - would that have something to do with this code section?
    CODE
    this.getView().controls.menuGrid.changeDataset(dataitem.feeds, true);
    this.getView().persist.results = dataitem.feeds;

    this.getView()._showHideBackButton();
    this.getView().controls.backButton.setText(dataitem.title);

    - changeDataset, in particular?

    I'm still just guessing - I've barely worked with the framework so I'm still learning my way around - but it seems like that might be doing what I need done. Am I on the right path with this?



    In your menu view, the main control that shows the data is the grid, right. And changeDataSet just changes the data in that grid to new data. You may ignore the other calls related to backbutton for now. The main issue right now is to get your menu view to display the menu items at any level. So, you can make the http call in the onSelect event handler for the cell and fetch its children, after which a callback can get those results and update the grid. So, now your view is effectively refreshed to the next level.

    Also, when you identify that a certain item is just a story and doesn't "contain" other children, then you can load the story view, which will of-course be a different view than this one.

    Thanks,
    Vivek
    0
  • Thanks for all the help - and I finally have the menu system working the way it should. But I'm encountering another problem (actually two, but I think they're the same problem)

    QUOTE (Vivek Jani @ Jul 13 2011, 05:24 AM) <{POST_SNAPBACK}>
    Also, when you identify that a certain item is just a story and doesn't "contain" other children, then you can load the story view, which will of-course be a different view than this one.


    My top-level menu is also a different view (view-Main instead of view-Menu), but I'm having problems working through the transition between menu views and non-menu views.

    Here are the two problems I'm having (I suspect they're actually the same issue:)

    1) I navigate through the menus until I get to a list of stories. At that level, I select a story, which loads that story into 'view-Story' and displays it. This works fine. THEN, I go back to the menu (also works) and select another story. Instead of loading the new story into 'view-Story', it re-displays the first one.

    2) I navigate through the menus and eventually back to the top level, which is 'view-Main' instead of 'view-Menu'. Then I select another menu to view, but it displays the first one.

    I have traced the values being passed through, and it seems that config.data in the menu view is NOT changing when I attempt to load a new menu. Looks like the same problem with the stories, too. So it hits updateView just fine, but then loads the OLD data instead of the new data.

    I have tried this (from within $API.selectView):
    CODE
    KONtx.application.addViewConfig({
    id: 'view-Story',
    viewClass: StoryView,
    data: this.my_item
    });
    KONtx.application.loadView('view-Story');

    and
    CODE
    KONtx.application.addViewConfig({
    id: 'view-Menu',
    viewClass: MenuView,
    data: this.my_item
    });
    KONtx.application.loadView('view-Menu');


    At this point in the code, the data in 'this.my_item' contains the CORRECT link & other information for the new view. BUT, when it gets to updateView, it contains the OLD data.

    I've also tried adding the config data to the loadView call, but I don't seem to be getting it quite right.
    0
  • Still trying to work this out.

    I found a post by Jeremy Johnstone here:
    http://developer.yahoo.net/forum/index.php...amp;#entry11253
    that appears to address the issue. He specifically says:

    QUOTE
    ...the system will detect a new view being added with the same ID and replace the old config with the new one.


    However, I am not seeing this occur.

    I have done a dump of the data being passed into the new view BEFORE calling KONtx.application.addViewConfig and KONtx.application.loadView, and then done a dump of the data in this.config.data from inside the view's updateView, and the view is definitely NOT updating the data in this.config.

    So I'm back to trying to figure out how to reuse an existing view for new data. In this case, the view doesn't appear to even be GETTING the new data - so I can't act on it at all. Any suggestions?
    0
  • QUOTE (Tony Garcia @ Jul 19 2011, 01:04 PM) <{POST_SNAPBACK}>
    Still trying to work this out.

    I found a post by Jeremy Johnstone here:
    http://developer.yahoo.net/forum/index.php...amp;#entry11253
    that appears to address the issue. He specifically says:



    However, I am not seeing this occur.

    I have done a dump of the data being passed into the new view BEFORE calling KONtx.application.addViewConfig and KONtx.application.loadView, and then done a dump of the data in this.config.data from inside the view's updateView, and the view is definitely NOT updating the data in this.config.

    So I'm back to trying to figure out how to reuse an existing view for new data. In this case, the view doesn't appear to even be GETTING the new data - so I can't act on it at all. Any suggestions?



    Have you tried to the following, for loading the story:

    KONtx.application.loadView("view-Story",{title:"story-x", content:"context-x"});

    Then in the StoryView's updateView method, you simply access this data as this.persist.title and this.persist.content. The "view-Story" view of course needs to be registered in the init.js. So, this way you are passing new data to the view every-time you call it and get it to display in your UI controls.

    -Vivek
    0
  • QUOTE (Vivek Jani @ Jul 20 2011, 06:03 AM) <{POST_SNAPBACK}>
    Have you tried to the following, for loading the story:

    KONtx.application.loadView("view-Story",{title:"story-x", content:"context-x"});

    Then in the StoryView's updateView method, you simply access this data as this.persist.title and this.persist.content. The "view-Story" view of course needs to be registered in the init.js. So, this way you are passing new data to the view every-time you call it and get it to display in your UI controls.


    Ok - it looks like that gets the data in, so we're 90% there - thanks!

    The only problem I have left now is that the paging breaks. Specifically, the current page doesn't reset when entering a new story. This isn't too bad if I read Story A with 4 pages, then go to Story B with 6 pages - it drops me on page 4, but at least it doesn't break. But if I go to Story B and go all the way to page 6, then to Story A, I get "Page NaN of NaN".

    I'm taking a look at the Pager and PageIndicator now to figure out how to get that to update.
    0
  • So, I can't seem to figure out how to get the page to reset to 1 after moving to the new story, and I'm not seeing any obvious way to do this.

    It looks like my text is in a TextGrid object, and I can't see how to access a Pager through there (I see it in the Grid object, but not in TextGrid or Text).

    Should I consider changing that to a Grid? Or is there a way to handle the paging reset through a TextGrid?
    0
  • Looks like I might have found something.

    I have this.controls.storyText that is the TextGrid object. Looking through the properties and methods of TextGrid, I see that the getCurrentPage() seems to work off the current value of firstLine. I noticed that when reentering the story view, firstLine was remaining at its previous setting.

    So, I thought that forcing firstLine back to 0 when loading the new story would solve the problem. I added the line in my updateView:
    CODE
    this.controls.storyText.firstLine = 0

    And - it works!

    So, am I seriously breaking anything by doing this, or do I have a workable solution? TESTING so far shows no problems, but I don't know if there might be a better or more proper way to do the same thing...
    0
  • You could make a request if you don't have the data for the next level from this onSelect handler itself, only difference is that when that request is done, the callback should call similar code as present in the else part i.e. change the grid data to the next level of data.

    Thanks
    Vivek
    0

Recent Posts

in General - Yahoo! TV Widgets