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

Tabbing problem with Modal Popup on Modal Popup

5 Answers 1115 Views
Window
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 27 Aug 2013, 02:37 PM
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?

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 28 Aug 2013, 11:08 AM
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.
0
John
Top achievements
Rank 1
answered on 28 Aug 2013, 03:27 PM
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.
0
Marin Bratanov
Telerik team
answered on 29 Aug 2013, 12:30 PM
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.
0
John
Top achievements
Rank 1
answered on 29 Aug 2013, 01:39 PM
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.
0
Marin Bratanov
Telerik team
answered on 02 Sep 2013, 03:11 PM
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.
Tags
Window
Asked by
John
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
John
Top achievements
Rank 1
Share this question
or