0

KONtx.dialogs.Alert problem

Hi there,

I have the following code in my view:

CODE
		var dialog = new KONtx.dialogs.Alert({
title: "Default Location",
message: "Would you like to Change your default location",
buttons: [
{ label: "Yes",
callback: function() {
log ("in this functionnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn");
KONtx.application.loadView('newview');
}
},
{ label: "No" }
]
});
dialog.show();


It successfully displays the alert dialog but when I click 'Yes' it doesn't call the code in the callback function like I thought it would. Instead it just goes back to the view. What have i missed?

Many thanks in advance!

by
4 Replies
  • QUOTE (c.penny67 @ May 18 2009, 11:14 AM) <{POST_SNAPBACK}>
    Hi there,

    I have the following code in my view:

    CODE
    		var dialog = new KONtx.dialogs.Alert({
    title: "Default Location",
    message: "Would you like to Change your default location",
    buttons: [
    { label: "Yes",
    callback: function() {
    log ("in this functionnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn");
    KONtx.application.loadView('newview');
    }
    },
    { label: "No" }
    ]
    });
    dialog.show();


    It successfully displays the alert dialog but when I click 'Yes' it doesn't call the code in the callback function like I thought it would. Instead it just goes back to the view. What have i missed?

    Many thanks in advance!


    Hi Penny,

    It seems your code is implemented in the function CreateView() ??
    I tried running it, but just declare dialog.Alert in the function CreateView(),
    and SHOW it in the function UpdateView().

    Like this:
    createView: function () {
    this.controls.dialog = new KONtx.dialogs.Alert({

    ...
    });
    },
    updateView: function() {
    this.controls.dialog.show();
    }

    And it ran your callback function.

    Hope it can help you.

    Jerry ^ _ ^
    0
  • Thanks Jerry! :DIn one case I spent ages trying to work out how to access a function of the Kontx.class when it was being called from within a GridCells onSelect method.... It turned out to be this.grid.owner.functionname() A better top down understanding of the Kontx.class would probably help these kinds of issues.
    0
  • QUOTE (c.penny67 @ May 19 2009, 05:28 AM) <{POST_SNAPBACK}>
    Is it possible for yahoo to create a 'cheat sheet' or tutorial that can explain the general Kontx.class framework? e.g. a timeline of what methods get called when; How to access different aspects of the class - this.owner etc

    In one case I spent ages trying to work out how to access a function of the Kontx.class when it was being called from within a GridCells onSelect method.... It turned out to be this.grid.owner.functionname() A better top down understanding of the Kontx.class would probably help these kinds of issues.


    We are working on something like this now. One thing which would help is if you would ask questions every time you have an issue. If you end up finding the answer before posting, please still post the question if you feel others might run into the same thing. We have an excellent tech writer who is working on a FAQ, but without having frequently asked questions from real users, the FAQ would simply be a collection of guesses of what we think people might need help with.

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ May 19 2009, 10:22 AM) <{POST_SNAPBACK}>
    We are working on something like this now. One thing which would help is if you would ask questions every time you have an issue. If you end up finding the answer before posting, please still post the question if you feel others might run into the same thing. We have an excellent tech writer who is working on a FAQ, but without having frequently asked questions from real users, the FAQ would simply be a collection of guesses of what we think people might need help with.

    -Jeremy


    This would be a great idea, as I'm stuck with KONtx.dialogs.Alert as well. I created an alert using almost the exact WDK documentation and upon running it I get an error that the object has no properties. It leads me to believe that there's something I'm missing beforehand. It actually is instantiated from another dialog box that does work but was built in a different (and now surely deprecated) way. I've yet to figure it out. A quick and broad guide to getting KONtx widgets running would be great.
    0

Recent Posts

in General - Yahoo! TV Widgets