Tabbing problem with Modal Popup on Modal Popup

6 posts, 0 answers
  1. John
    John avatar
    44 posts
    Member since:
    Apr 2011

    Posted 27 Aug 2013 Link to this post

    We have a user control that contains the window definition for two modal popups.  The first modal popup is accessed from a link button on the user control.  The second popup is accessed from a linkbutton on the first modal popup.  The second modal popup then has all the tabindices set to -1 (disabled).  The work around is to have a function called when the second popup is shown that sets the tabstops back to what they should be for the second popup.

    I noticed that there is code in the telerik window manager that sets the tab indices to -1 for all windows that are not the currently displayed popup.  It apparently does not set them back properly for the second popup in this scenario.

    Has this been fixed since the October 2012 release?
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 28 Aug 2013 Link to this post

    Hello John,

    When a modal RadWindow is shown all other focusable elements on the page get their tabIndex attributes set to -1 to achieve the modal effect. Here are the implications related to your case:
    - we cannot know if some of the elements are inside other RadWindows, RadToolTips or other custom popups
     - even if similar checks are added (that could cover only our controls), proper behavior for such elements cannot be defined - leaving their original tabIndex values will make the popup non-modal because they will be able to take focus to the main page; on the other hand we cannot know if one of them is going to be shown in order to attempt to keep and restore its z-index values.

    Usually, only one modal popup should be present on the page, because its wai-aria definition is a dialog that holds the user focus until it is closed or submitted, so opening another modal popup should, by definition, take the focus away from the first, breaking its function.

    If the first popup is closed before the second is opened the elements in it should have their proper tabIndex values restored.

    Another thing you can consider is using an entire page for the RadWindow contents, instead of its ContentTemplate. Thus, the second popup's contents will be in a separate context and the first modal popup will not be able to reach them (nor will the user while the popup is not shown).


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. John
    John avatar
    44 posts
    Member since:
    Apr 2011

    Posted 28 Aug 2013 Link to this post

    Since a button on the first popup invokes the second popup, the first popup is correctly disbled and cannot be dismissed until the second popup is dismissed.
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 29 Aug 2013 Link to this post

    Hello John,

    You can close the first dialog with JavaScript before you open the second one, e.g.:
    <asp:Button ID="Button1" Text="open second dialog" OnClientClick="openSecondPopup(); return false;" runat="server" />
    <script type="text/javascript">
        function openSecondPopup()
        {
            var wnd1 = ""; //get reference to the first (current) dialog
            var wnd2 = ""; //get reference to the second dialog
            wnd1.close();
            wnd2.show();
        }
    </script>



    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. John
    John avatar
    44 posts
    Member since:
    Apr 2011

    Posted 29 Aug 2013 Link to this post

    In this case, that is not really useful.  We need to come back to the first popup after the second is dismissed - without losing any of the data in the first popup.
  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 02 Sep 2013 Link to this post

    Hello John,

    If you do not have custom code that modifies the popup when it is closed or shown then calling its show() method in the OnClientClose handler of the second dialog will show it in the same state that it was closed in. Closing a RadWindow only hides it with CSS.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017