RadGrid erroneously firing timeout

12 posts, 0 answers
  1. Chris
    Chris avatar
    40 posts
    Member since:
    Feb 2009

    Posted 11 Feb 2011 Link to this post

    The following issue occurs in Chrome 9.0.597.98 beta. I can't reproduce it in Firefox or IE. Here goes. 

    So, I have the following javascript running on every page in my web app:

    var TIMEOUT_DURATION = 1200000;
    var timerID = null;
     
    function onLogoutTimeout()
    {
        $("a").each(function ()
        {
            var isLogoutLink = jQuery(this).attr("id").toString().search(new RegExp(/signoutLink/i));
            if (isLogoutLink >= 0)
                document.location = this.href;
        });
    }
     
    function onResetTimer()
    {
        clearTimeout(timerID);
        timerID = setTimeout("onLogoutTimeout()", TIMEOUT_DURATION);
    }
     
    $(document).ready(function ()
    {
        timerID = setTimeout("onLogoutTimeout()", TIMEOUT_DURATION);
     
        $(this).mousemove(function (e) { onResetTimer() });
        $(this).keydown(function (e) { onResetTimer() });
    });

    Basically, it sets a timeout so that if a user is idle for to long, it will log them out. You'll notice that I'm using jQuery. I'm using the jQuery that comes packages with the Telerik controls. I'm using 2010.3.1317.40. The following is a simple page with a RadGrid on it:

    <%@ Page Title="" Language="C#" MasterPageFile="~/Includes/MasterPages/GofrPortalMasterPage.master"
        AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Organization_Admin_Users_Default"
        Culture="auto" UICulture="auto" %>
     
    <asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="PageTitle" runat="Server">
        <asp:Localize runat="server" meta:resourcekey="PageTitle"></asp:Localize>
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">
        <telerik:RadCodeBlock ID="rcbCodeBlock" runat="server">
            <script type="text/javascript">
                if (typeof SubscribeToWindowClose == "function")
                {
                    SubscribeToWindowClose("rwCreateUser", OnCreateUserWindowClose);
                    SubscribeToWindowClose("rwEditUser", OnCreateUserWindowClose);
                }
     
                function OnCreateUserWindowClose(args)
                {
                    var userGridAjaxPanel = $find("<%= rapUserGrid.ClientID %>");
                    userGridAjaxPanel.ajaxRequest("Rebind");
                }
            </script>
        </telerik:RadCodeBlock>
        You can add users by clicking on the plus icon or modify them by clicking on their
        email address.<br />
        <br />
        <telerik:RadAjaxPanel ID="rapUserGrid" runat="server" OnAjaxRequest="OnUserGridAjaxRequest"
            LoadingPanelID="loadingPanel">
            <telerik:RadGrid ID="rgUser" runat="server" EnableEmbeddedSkins="False" Skin="GofrDefault"
                GridLines="None" AutoGenerateColumns="False" OnItemDeleted="OnItemDeleted" OnNeedDataSource="OnNeedUsersDataSource"
                OnDeleteCommand="OnDeleteUser" AllowSorting="true">
                <MasterTableView DataKeyNames="AssetID" CommandItemDisplay="Top" meta:resourcekey="GridMasterTableView">
                    <Columns>
                        <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmText="Are you sure you want to delete this user?"
                            ConfirmTitle="Confirm Delete" UniqueName="DeleteColumn" CommandName="Delete" ImageUrl="~/Skins/GofrDefault/Grid/Delete.gif"
                            ItemStyle-Width="1em" meta:resourcekey="UserGridDeleteColumn">
                        </telerik:GridButtonColumn>
                        <telerik:GridHyperLinkColumn HeaderText="Email Address" SortExpression="EmailAddress"
                            ItemStyle-Width="30em" DataTextField="EmailAddress" DataNavigateUrlFields="AssetID"
                            DataNavigateUrlFormatString="javascript:OpenRadWindow_NoReturn('rwEditUser', {{'UserID':{0}}})"
                            meta:resourcekey="UserGridEmailColumn">
                        </telerik:GridHyperLinkColumn>
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" SortExpression="FirstName"
                            meta:resourcekey="UserGridFirstNameColumn">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" SortExpression="LastName"
                            meta:resourcekey="UserGridLastNameColumn">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <CommandItemTemplate>
                        <div class="gridCommandItemDiv">
                            <asp:HyperLink runat="server" CssClass="gridCommandItem" Text="<%$ Resources:VirtualOfficeResources, CreateUserLabel %>"
                                NavigateUrl="javascript:OpenRadWindow_NoReturn('rwCreateUser', null, null)" ImageUrl="~/Skins/GofrDefault/Grid/AddRecord.gif"
                                ToolTip="Create User"></asp:HyperLink>
                        </div>
                    </CommandItemTemplate>
                </MasterTableView>
                <FilterMenu EnableEmbeddedSkins="False">
                </FilterMenu>
                <HeaderContextMenu EnableEmbeddedSkins="False">
                </HeaderContextMenu>
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
        <telerik:RadAjaxLoadingPanel ID="loadingPanel" runat="server" Transparency="0" IsSticky="true">
            <asp:Panel ID="innerLoadingPanel" runat="server" CssClass="innerLoadingPanel">
                <table>
                    <tr>
                        <td>
                            <asp:Image runat="server" ImageUrl="~/Skins/GofrDefault/Common/loading.gif" />
                        </td>
                        <td style="color: White; padding-left: 1em; font-size: larger">
                            <asp:Localize runat="server" Text="<%$ Resources:VirtualOfficeResources, LoadingLabel %>"></asp:Localize>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <ajax:AlwaysVisibleControlExtender runat="server" HorizontalSide="Center" VerticalSide="Middle"
                VerticalOffset="150" HorizontalOffset="100" TargetControlID="innerLoadingPanel">
            </ajax:AlwaysVisibleControlExtender>
        </telerik:RadAjaxLoadingPanel>
    </asp:Content>

    So basically what is happening is that when I push the delete button next to a user, it is firing the onLogoutTimeout() javascript timeout. The confirm dialog comes up, on confirm the server side event gets fired, and then this timeout event gets fired, which logs a user out. Not sure why this is happening. Any help would be appreciated.
  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 16 Feb 2011 Link to this post

    Hello Chris,

    Could you try the following set-up: add a link button on the page outside the grid. Click it and see if the same behavior aspires. Looking forward to your feedback.

    Regards,
    Tsvetoslav
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Chris
    Chris avatar
    40 posts
    Member since:
    Feb 2009

    Posted 17 Feb 2011 Link to this post

    Okay, did that and the behavior did not show up.
  4. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 22 Feb 2011 Link to this post

    Hi Chris,

    Thanks for confirming that the problem is not reproduced outside of RadGrid.

    Please, isolate the problem into a small runnable sample, open up a formal support ticket and send it to us for debugging as from the pasted code it cannot be ascertained what sequence of client-side events (not user actions) leads to the issue discussed.

    Thanks for that.

    Regards,
    Tsvetoslav
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  5. Chris
    Chris avatar
    40 posts
    Member since:
    Feb 2009

    Posted 28 Feb 2011 Link to this post

    I have been unable to reproduce it in a smaller project. If you want, I would be more than happy to setup a GoToMeeting or something to show you guys if you are interested.
  6. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 02 Mar 2011 Link to this post

    Hello Chris,

    Is it then possible to send your project with the necessary files to run it on our side?

    Best wishes,
    Tsvetoslav
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  7. Chris
    Chris avatar
    40 posts
    Member since:
    Feb 2009

    Posted 02 Mar 2011 Link to this post

    No, it has intellectual property in it.
  8. Chris
    Chris avatar
    40 posts
    Member since:
    Feb 2009

    Posted 03 Mar 2011 Link to this post

    Ok, I spent a little more time at it and was able to successfully create a small project to duplicate the problem I'm seeing. You can find it at http://telerik.ourdoings.org. 

    Username: telerikuser
    Password: Password!

    This is just a test project to show it. Nothing sensitive. I'd be more than happy to send the project to you. The project might be a chore to setup since it is using Windows Identity Foundation and Active Directory Federation Services.

    Notice that this problem only occurs in Chrome and only on delete. Let me know if you need anything else to help you.
  9. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 07 Mar 2011 Link to this post

    Hello Chris,

    Thanks for that. I did observe the problem and as faar as Chrome's developer tool allowed me, managed to ascertain that this issue actually occurs on any input on the page, as long as that one has a confirm dialogue. What is did is change the dom element for the add new item button by inserting a confirm dialogues into its onclick event - the result was the same: user logged out. Then I added into the dom tree a simple input outside the grid with a confirm dialogue on its onclick event and the effect was once again a redirect to the log-in page. I am not sure why this is happening but would appreciate sending the code for the sample - I will try to adapt it to run on my side.

    Thaks.

    Regards,
    Tsvetoslav
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  10. Chris
    Chris avatar
    40 posts
    Member since:
    Feb 2009

    Posted 08 Mar 2011 Link to this post

    What's the best way to send the code? I can't attach a zip to this thread.
  11. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 09 Mar 2011 Link to this post

    Hello Chris,

    Sorry for having missed to point this out - you should open a support ticket (which is different from a forum thread) - this will allow you to send attachments.

    Best wishes,
    Tsvetoslav
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  12. Themba
    Themba avatar
    1 posts
    Member since:
    Jun 2015

    Posted 13 Feb 2017 Link to this post

    I am having the same issue with the Radgrid. On my observation, i have noticed that this occurs when the dataset query contains conditional if statements or union. NB: This does not happen every time the query is executed, sometimes in runs fine without any error.

     

    Thanks 

Back to Top