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

RadConfirm not blocking the exeution

1 Answer 269 Views
Window
This is a migrated thread and some comments may be shown as answers.
Hema Raju
Top achievements
Rank 1
Hema Raju asked on 20 Apr 2011, 03:31 PM
Hi,

I call a RadConfirm box from a JavaScript function like:

$get("<%=btnNoVr.ClientID%>").onclick = function()
                {
                    CallRadConfirm(stat, id,  'Can you Confirm?');
                };


function CallRadConfirm(status, ID, message)
    {  
        radconfirm(rmessage, confirmCallBackFn, 350, 10, '', 'Confirm');
        
        function confirmCallBackFn(arg)
        {
            if(arg == true)
            {
                $get("<%=hfIsNoVR.ClientID%>").value = "Y";
                if (status == "true")
                {
                    return true;
                }
                else
                {
                    window.location.href = '/_layouts/test/test.aspx?ID=' + ID + '&PageFrom=Select&Action=NO';
                    window.event.returnValue=false;
                }
            }
        }      
    }

here i get the Confirmation box but postback happens immediatelly before i chose ok or cancel.
How do i stop that?

Thanks,
Varun R

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Apr 2011, 04:16 AM
Hello Hema,

Unlike the standard confim(), radconfirm() cannot block the execution of the thread and it needs a CallBackFunction. So once the user confirms the postback, in the radconfirm's CallBackFunction you need to use  __doPostBack to call server side event. I believe the following Code Library will be of help in achieving this functionality;
Using radconfirm() CallBackFunction to perform a postback

You can also refer to the following code library submission inorder to allow the radconfirm window to simulate the blocking of the execution thread while waiting for user's confirmation:
Block the execution thread with radconfirm.

The predefined dialogs (radalert, radconfirm and radprompt) can be now called by using the new server methods RadAlert, RadConfirm  and RadPrompt of the RadWindowManager
So I recommend you to use this simple approach to block the execution thread with radconfirm.

Thanks,
Shinu.
Tags
Window
Asked by
Hema Raju
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or