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

CallBackFnName fire before click at Ok button

1 Answer 31 Views
Window
This is a migrated thread and some comments may be shown as answers.
Paulo Goncalves
Top achievements
Rank 2
Paulo Goncalves asked on 08 May 2013, 07:25 PM
This code work before upgrade from 2012.3.1016.40 to 2013.1.417.40. Now the RadAjaxManager1_AjaxRequest fired before I click at Ok button. When click at 'Button1' the request is fired. I rerturn to 2012.3.1016.40 and the problem continue. Any idea ?

Default.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="cPanel_Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
 
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
 
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function confirmCallBackFn(arg) {
                    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                    ajaxManager.ajaxRequest(arg);
                    return false;
                }
            </script>
        </telerik:RadCodeBlock>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Button1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <telerik:RadWindowManager ID="RadWindowsManager1" runat="server" Title="Editar" Behaviors="Close,Move" VisibleStatusbar="false" style="z-index:90000" EnableEmbeddedSkins="false" ShowContentDuringLoad="true" ReloadOnShow="true" DestroyOnClose="true" >
        </telerik:RadWindowManager>
 
        <asp:button ID="Button1" runat="server" text="Button" />
    </div>
    </form>
</body>
</html>

Default.aspx.vb
Partial Class cPanel_Default
    Inherits System.Web.UI.Page
 
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
 
        RadWindowsManager1.RadConfirm("Callback ?", "confirmCallBackFn('Ok')", 300, 120, Nothing, "Test")
 
    End Sub
 
    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
 
        If e.Argument = "Ok" Then Button1.Text = e.Argument
 
    End Sub
End Class

Thanks
Paulo

1 Answer, 1 is accepted

Sort by
0
Paulo Goncalves
Top achievements
Rank 2
answered on 09 May 2013, 01:58 PM
Hi, the problem is fixed.

To reuse the JS functions, I create an agument at callback function, the RadWindow donĀ“t return error and execute callback function before click at Ok button.

Te correct call is:
RadWindowsManager1.RadConfirm("Callback ?", "confirmCallBackFn", 300, 120, Nothing, "Test")

and I need one callbackfunction to each radconfirm
.

Tags
Window
Asked by
Paulo Goncalves
Top achievements
Rank 2
Answers by
Paulo Goncalves
Top achievements
Rank 2
Share this question
or