Change of return args in 2015 Q3

5 posts, 1 answers
  1. Andreas
    Andreas avatar
    137 posts
    Member since:
    May 2008

    Posted 05 Oct 2015 Link to this post

    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

     

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 06 Oct 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andreas
    Andreas avatar
    137 posts
    Member since:
    May 2008

    Posted 06 Oct 2015 in reply to Marin Bratanov Link to this post

    Hi,

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

    Regards
    Andreas
  5. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 06 Oct 2015 Link to this post

    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
  6. Andreas
    Andreas avatar
    137 posts
    Member since:
    May 2008

    Posted 06 Oct 2015 in reply to Marin Bratanov Link to this post

    Thanks!

    Workaround works for now...

    Regards
    Andreas

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017