Why does pressing ENTER button close my rad windows???

14 posts, 0 answers
  1. Acadia
    Acadia avatar
    203 posts
    Member since:
    May 2005

    Posted 01 Mar 2009 Link to this post

    When I have a rad window open if I click the title bar of the window so that the window itself has the focus, then I hit enter, the window closes.  This is very annoying and I need to stop it from happening, but I can't seem to stop it completely.  I can stop it from happening when the user has the focus on a control on the window's form, but not the rad window itself.

    Thanks
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 02 Mar 2009 Link to this post

    Hello Acadia,

    You are the first to report such problem and I cannot reproduce it locally. Could you please let me know if you can reproduce the same behavior in any of our online demos?

    If you cannot reproduce the problem in the demo pages, please open a support ticket and send us a small sample project where this issue can be observed. We will check it and do our best to help.


    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Acadia
    Acadia avatar
    203 posts
    Member since:
    May 2005

    Posted 02 Mar 2009 Link to this post

    I was not able to reproduce it on the demo I tried.  What seems to be happening is that my window is open by clicking a link button on my grid.  When the window opens if I don't do anything except hit the enter key, the grid that the window was open from does a post back as though the first button on the first row had been clicked.  If I make the first button invisible it clicks the second button on the grid.  Very strange but I simply can't find a way to stop it.  I've tried everything.  This is also happening with windows opened by buttons outside of the grid (on the main page) except when the window closes nothing happens it just returns to the main page.

    It seems to be some kind of focus issue where when the rad window opens, the first object on the control that opened the window maintains the focus and gets clicked when you hit enter.

    I suppose I could try putting an empty 1 px label in the very first cell of the grid that opens the window so that nothing happens when I hit enter, but I would think there is a better solution.  This is a big problem because users sometimes accidentally hit the enter key.  I capture the event when they do it once a control on the window has the focus, but I can't prevent it when they first come into the window and accidentally hit enter.

    I'll let you know what I find.

    Thanks
  5. p braunstein
    p braunstein avatar
    1 posts
    Member since:
    Aug 2009

    Posted 25 Aug 2009 Link to this post

    FYI, I'm building an asp.net app and have found that when I force focus to be on a textbox when the window opens (so users can immediately begin entering data without having to click the box), and then blindly hit the <enter> key, the window closes.  When I open a form with NO cursor focus, I can beat on the <enter> key all I want and the form remains open.  This is a real nuisance for me; there are times when you can click or tab to a button and hit <enter> and I DO want the system to do things in the code behind, but other times I just want to ignore the click and leave the screen up.
  6. Jakub Gutkowski
    Jakub  Gutkowski  avatar
    5 posts
    Member since:
    Nov 2008

    Posted 02 Dec 2009 Link to this post

    I have the same issue with Enter.

    by default Enter is refreshing the rad window content (don't know why). If focus is inside the window, enter is closing it by my "cancel" button:

    <asp:Button runat="server" ID="btnCancel" Text="Anuluj" Width="120px" OnClientClick="closeDisplayContractors(true); return false;" CausesValidation="false" />

    btnCancel is the last element on the page. If I will add a dummy button after btnCancel, the dummy button is called instead of btnCancel.

    this is a quite annoying thing as I've got a search text box in that window:
    <telerik:RadTextBox runat="server" ID="txtSearchBox" EmptyMessage="(podaj wartość)" Width="100%">
                            <ClientEvents OnKeyPress="shouldSubmitSearch" />                             
                        </telerik:RadTextBox>

    This box i taking a OnKeyPress and on enter, should preform search, but instead its still closing a window.
    Please help.

    Cheers,
       Jakub G
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 03 Dec 2009 Link to this post

    Hi guys,

    I would suggest to manually remove the focus from the element that called the RadWindow (by using blur()) or as an alternative - to set the focus on the content page. For example you can use the native ASP.NET AJAX pageLoad() function
    e.g.
    function pageLoad()
    {
       $get("<%= TexBox1.ClientID %>").focus();
    }



    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Jakub Gutkowski
    Jakub  Gutkowski  avatar
    5 posts
    Member since:
    Nov 2008

    Posted 03 Dec 2009 Link to this post

    Hi Georgi,

    blur() helped with first issue: window is refreshing content on pressing Enter after calling radopen(...).

    But still issue with enter exists inside window. I have focus on search text box, when I press enter following code is executed (java script):
    function shouldSubmitSearch(sender, args) { 
                    if (args.get_keyCode() != 13) { 
                        // character will be added 
                        return true
                    } 
     
                    submitSearch(); 
                    // enter will not be added as character 
                    return false
                } 
     
                function submitSearch() { 
                    var searchText = $telerik.$('#<%= txtSearchBox.ClientID %>'); 
                    var columnField = $find('<%= rcbSearchColumn.ClientID %>'); 
     
                    alert(searchText.val()); 
                     
                    return false
                } 

    and just after alert(searchText.val()), btnCancel event if fired even though the focus is on search box.

    Cheers,
       Jakub G
  9. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 04 Dec 2009 Link to this post

    Hello Jakub,

    To see if the problem is related to the RadWindow control, please replace it with a standard IFRAME and see if the same problem occurs again. If it doesn't, e.g. it is reproducible only when RadWindow is involved, please open a support ticket and send me a sample project so I could investigate further.


    Kind regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. Andreas Rehm
    Andreas Rehm avatar
    1 posts
    Member since:
    Jan 2010

    Posted 21 Jan 2010 Link to this post

    The solution is quite simple: You need a dummy button! Yes - it's not a joke. Just add a button on top of your pane:

    <asp:ImageButton ID="DummyButton" runat="server" ImageUrl="~/images/1x1.GIF" onClientClick="return false;" />

    You need a 1x1 transparent GIF picture.

    This solution is a quick and dirty hack - there is a bug in the event management. The RadPane seems to send events to all RadPanes on the same page. If your event is a Click or PostBack it will fire on the first control. This dummy fires a client event "return false" which does not do a postback.

    Regards
  11. Joe Parks
    Joe Parks avatar
    4 posts
    Member since:
    Jun 2012

    Posted 08 Mar 2010 Link to this post

    The invisible image button did not work for me.
    Wrapping a dummy button in a hidden div does work for me:
    <div style="display:none"><asp:Button ID="foo" runat="server" OnClientClick="return false;" /></div

    This is the same problem described here:
    http://www.telerik.com/community/forums/aspnet-ajax/form-decorator/problem-with-radformdecorator-and-login-control.aspx




    -Joe Parks


  12. Brian
    Brian avatar
    19 posts
    Member since:
    Apr 2007

    Posted 22 Sep 2010 Link to this post

    Was there ever an official answer on how to solve this problem?  I am experiencing the same issue where my window will close (and execute the code behind the first button on the screen).  Plus my radwindow will close (and execute the code behind the first button on the screen) if I hit the backspace key while the cursor is in a readonly radtextbox.

    Brian
  13. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Sep 2010 Link to this post

    Hi Brian,

    In general, the problem described here refers to a specific setup, so there is no universal solution that we could implement in our code.
    Please open a support ticket and send us a small sample project that reproduces your exact setup so we can check it. Once we receive it, we will do our best to provide you with the most appropriate solution.

    Greetings,
    Georgi Tunev
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  14. Dru
    Dru avatar
    5 posts
    Member since:
    Aug 2007

    Posted 14 Jun 2011 Link to this post

    I just disabled the enter key.  Enter still works in RadEditors that are on the page as well.  This might not be a valid solution for everyone, but in my situation it was. 

     

    <form id="form1" runat="server" onkeydown="return DisableEnterSubmit(event.keyCode);">

    <script type="text/javascript">       

        function DisableEnterSubmit(key) {
            if (key == 13) {
                return false;
            }
        }

    </script>

     

  15. <span>w</span>
    <span>w</span> avatar
    84 posts
    Member since:
    Jun 2012

    Posted 11 Oct 2012 Link to this post

    Some time When you Press enter , Radwindow automatically open and some time when you enter Radwindow automatically close.
    I my project . this condition arise, when i did not refresh my parent page, just only refresh one drop down.
    When i enter some text in textbox. it refreshes. (simple just disable your enter key).

    <script type="text/javascript">
              function DisableEnterSubmit(key) {
                  if (key == 13) {
                      return false;
                  }
              }
    </script>
      <form id="form1" runat="server" onkeydown="return DisableEnterSubmit(event.keyCode);">
      </form>
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017