7 Answers, 1 is accepted

sSave = radconfirm(
"You have some TRU changes that have not been saved. Click OK to SAVE now or CANCEL to continue without saving.");
BUT I get 2 windows... A IE confirmation and then a RADWINDOW
????
Any ideas?

Unlike the normal window.confirm, RadConfirm takes atleast two arguments- string message and the name of the function that deals with the results. In your example change the Confirm Dialog as shown below.
radconfirm("You have some TRU changes that have not been saved. Click OK to SAVE now or CANCEL to continue without saving.", confirmCallBackFn); |
Add the JavaScript function named "confirmCallBackFn" for checking the result:
<script type="text/javascript"> |
function confirmCallBackFn(arg) |
{ |
if (arg==true) |
//Clicked OK |
else |
//Cliked Cancel |
} |
</script> |
Please refer the online documentation for more details:
Working with the Confirm Dialog
Thanks,
Shinu.


If i'm not wrong Radconfirm, RadAlert and RadPrompt ARE modal. In the sense that they disable elements on the page until they are closed. Think this is modal window. :)

<script type="text/javascript" language='JavaScript'>
window.onbeforeunload = checkSave;
var isDirty;
isDirty = 0;
function setDirty() {
isDirty = 1;
}
function checkSave() {
var sSave;
if (isDirty == 1) {
sSave = radconfirm(
"You have some TRU changes that have not been saved. Click OK to SAVE now or CANCEL to continue without saving.", confirmCallBackFn, 300, 100, null, 'TRU');
}
}
</script>
<script type="text/javascript">
function
confirmCallBackFn(arg)
{
if (arg == true) {
//Clicked OK
}
else {
//Cliked Cancel
}
}
</
script>

and I can navigate away from the page.
thanks
All RadWindows (including confirm, prompt and alert popups) are DHTML objects - that is, they consist of HTML and JavaScript. With HTML it is not possible to achieve absolute modality - like it can be done with a browser alert for example. That is, the modality of the RadWindow goes only as far as the content page of the browser, but it cannot disable user actions such as typing a new URL in the browser address bar or using the Back/Forward/Reload browser buttons.
Greetings,
Tervel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.