This is a migrated thread and some comments may be shown as answers.

RadWindow : Confirm Box

4 Answers 269 Views
Window
This is a migrated thread and some comments may be shown as answers.
Suzi
Top achievements
Rank 1
Suzi asked on 10 Sep 2008, 07:39 AM
Hi,

I have a button named "Delete Element". When I click overthere, it deletes the element ( server-side ). 

<

asp:LinkButton ID="rteLnkBtnDeleteFlash" runat="server" Text="Supprimer ce flash"

onclick="rteLnkBtnDeleteFlash_Click"></asp:LinkButton>

I would like to display a radWindow to confirm the delete ( maybe a radconfirm ) to ask if the user want to really delete the element. If he clicks YES, I would like to call my delete method ( rteLnkBtnDeleteFlash_Click ) which is into the server side, but not into the client side.

But how may I to do it with a radconfirm or other rad component ?

<button style="width:150px" onclick = "radconfirm('Are you sure?', confirmCallBackFn); return false;">show CONFIRM BOX</button> 
      function confirmCallBackFn(arg)
    {
       alert("I want to delete the element here into the server side if it is true ...);

   }

Thank you in advance,

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 10 Sep 2008, 08:00 AM
Hi Suzi,

Basically what you need to do is to check if the user has clicked Yes in the confirm dialog and then to send this information to the server somehow.
This (sending arguments from the client to the server with JavaScript) is a general task - for example you can use __doPostBack() or RadAjax's ajaxRequest call to do this.


<script type="text/javascript">  
function ValidateFn()  
{  
    radconfirm("sure?", callbackFn);   
    return false;  
}  
function callbackFn(arg)  
{  
    //if the validation passes - 'simulate' the button's click  
    if (arg)  
        {  
           __doPostBack("<%= LinkButton1.ClientID %>","");  
        }  
}  
</script> 
 
<radW:RadWindowManager ID="RadWindowManager1" runat="server">  
</radW:RadWindowManager> 
<asp:LinkButton OnClientClick="ValidateFn(); return false;" ID="LinkButton1" runat="server" Text="Click me"></asp:LinkButton> 


Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Suzi
Top achievements
Rank 1
answered on 10 Sep 2008, 08:46 AM
Tahnk you for your help, I tried your example, but

I have this error when I try the example :

this._windows is null
_createWindow()("confirm1221036027851", false)ScriptRe...fa0a7f2eb (ligne 177)
_getStandardPopup()("confirm", "Etes-vous sûr de vouloir supprimer ce flash ?", undefined)ScriptRe...fa0a7f2eb (ligne 188)
radconfirm()("Etes-vous sûr de vouloir supprimer ce flash ?", callbackFn(arg), undefined, undefined, undefined, undefined)ScriptRe...fa0a7f2eb (ligne 19)
ValidateFn()flash.aspx (ligne 484)
onclick()flash.aspx (ligne 1)

this._windows[this._windows.length]=wnd;

I put the RadWindowManager into the page.

I have the impression than it can't find the windows.

Do you have any idea of the problem ?

Thank you in advance,
0
Suzi
Top achievements
Rank 1
answered on 10 Sep 2008, 09:39 AM
I have this bug because I am using several RadWindowManager ... How may I to specify which radwindowManager the radConfirm have to use ?
0
Georgi Tunev
Telerik team
answered on 10 Sep 2008, 01:07 PM
Hi Suzi,

By design radconfirm(), radprompt(), radalert(), radopen() and GetRadWindowManager() will always use the RadWindowManager that is rendered first on the page.
The error that you receive however, leads me to believe that the problem is somewhere else. Do you update with Ajax the RadWindowManager? Can you please provide more details about your exact setup?



Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Suzi
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Suzi
Top achievements
Rank 1
Share this question
or