0

redefining backButton action

Hello,

Is it possible te change the action associated with a backButton ?

According to the documentation (v0.96), when the onSelect event is fired the KONtx.application.previousView() function is executed. I tried to redefined the action associated with the onSelect event (code below) but the previousView() is still executed. Can I prevent the execution of previousView() ?

this.controls.backButton = KONtx.control.BackButton({

});

by
3 Replies
  • ** typing error** Sorry, I sent the message while I was writing my code. So here is the code:

    this.controls.BackButton({
    label: "back to home",
    guid: "back_button",
    events: {
    onSelect: function(event) {
    KONtx.application.loadView("view-home");
    }
    }
    }).appendTo(this);
    0
  • QUOTE (cotreaudaubonne @ May 13 2009, 05:15 AM) <{POST_SNAPBACK}>
    ** typing error** Sorry, I sent the message while I was writing my code. So here is the code:

    this.controls.BackButton({
    label: "back to home",
    guid: "back_button",
    events: {
    onSelect: function(event) {
    KONtx.application.loadView("view-home");
    }
    }
    }).appendTo(this);


    This breaks the interaction defined for the widget. Can you provide more details on why you want to jump directly to "home" instead of going back? If it's because there is a middle page you don't want in the history, there is a better fix.

    For example, if your widget does this:

    Home -> View A - > View B

    and you don't want back to take a user from View B to View A, then when calling loadView on View A to go to View B, do something like the following:

    KONtx.application.loadView('view-B', <your persist params or {} if none>, true);

    What that does is tell the application to not store View A in the history. An example of where this is used in one of our widgets is the Yahoo! Video widget. When going from the player view to the post roll view, we don't want the user to land on the player when hitting back from post roll, but rather go all the way back to the sidebar detailed page, thus we do something like the above.

    -Jeremy
    0
  • Thank you very much, that could fit with what I want to do !
    0

Recent Posts

in General - Yahoo! TV Widgets