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

Change of return args in 2015 Q3

4 Answers 21 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 05 Oct 2015, 12:23 PM

Hi,

We are using the args parameter for windows a lot throughout our application, and something has changed here since the last version!

For example if setting the OnClientClick="function(sender, args){alert(args.get_argument());}", in the old version (2015 Q2) that return "null" when closing the window, but in the new Q3 release it returns "object" when pressing the close button of the radwindow!

Full example:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="window.aspx.vb" Inherits="TestaTredjepartWeb.window" %>
 
<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="s" runat="server">
        </asp:ScriptManager>
        <div>
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                <Windows>
                    <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" RenderMode="Lightweight" Title="Hello" OnClientClose="function(sender, args){alert(args.get_argument());}">
                    </telerik:RadWindow>
                </Windows>
            </telerik:RadWindowManager>
        </div>
    </form>
</body>
</html>

 

The object returned seems to be a browser event-object... And when examining your source code it tries to detect this and return null, but only if the object is a Sys.UI.DomEvent, which it isn't in the new version!

Regards
Andreas

 

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Oct 2015, 08:25 AM

Hello Andreas,

I just tested this and I got the expected null in the alert when I pass no arguments to the close() method in all browsers. Can you review the sample I attached and show me the difference that causes the problem?

The first piece of code that checks for the argument type has not been changed since it was added in 2010 and the other occurrence of the check is from 2013. There have been no changes to the close() method lately and this leads me to believe that something else is going on but to find out what it is, I would need to be able to reproduce the issue first.

Regards,

Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andreas
Top achievements
Rank 1
answered on 06 Oct 2015, 08:30 AM

Hi,

The problem is not when manually calling the close function, but when pressing the x in the window title!

Regards
Andreas
0
Accepted
Marin Bratanov
Telerik team
answered on 06 Oct 2015, 09:47 AM

Hello Andreas,

Thank you for the clarification. I am logging this for fixing and you can track its progress in the following page: http://feedback.telerik.com/Project/108/Feedback/Details/171315-mouse-event-is-passed-to-the-close-handlers-when-the-x-button-is-clicked-in-q3. We will try to get this addresses for the Q3 2015 SP1 release. I have also updated your Telerik points for your report.

I am pasting here the possible workarounds from the Feedback portal page:

<telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" RenderMode="Lightweight" OnClientClose="theCloseEventsHandler" OnClientBeforeClose="theCloseEventsHandler">
</telerik:RadWindow>
<script>
    function theCloseEventsHandler(sender, args) {
        var arg = args.get_argument();
        //workaraound 1
        //if (arg.target && arg.which) { //it is the mouse event
        //  arg = null;
        //}
        alert(arg);
    }
 
    //workaround 2. Using either is enough
    //var oldClose = Telerik.Web.UI.RadWindow.prototype.close;
    //Telerik.Web.UI.RadWindow.prototype.close = function (arguments) {
    //  if (arguments.target && arguments.which) {
    //      arguments = null;
    //  }
    //  var _oldClose = Function.createDelegate(this, oldClose);
    //  _oldClose(arguments);
    //}
</script>

Regards,

Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andreas
Top achievements
Rank 1
answered on 06 Oct 2015, 09:57 AM

Thanks!

Workaround works for now...

Regards
Andreas

Tags
Window
Asked by
Andreas
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or