A function that is attached to this event is triggered on clicking the RadWindow's toolbar, even if it is already active.
The Window will not open in the center of the screen if it was already opened once and the page has been scrolled. It seems that the Window keeps opening at the same position initially was opened, hence it could open out of screen bounds.
Code
<style>
.mydiv {
margin: 2000px 100px;
}
</style>
<telerik:RadWindow ID="RadWindow1" runat="server">
<ContentTemplate>
<h3>RadWindow1 Content</h3>
</ContentTemplate>
</telerik:RadWindow>
<script>
function ShowEditForm(sender, args) {
var wnd = $find("<%= RadWindow1.ClientID %>");
wnd.show();
}
Sys.Application.add_load(function () {
setTimeout(function () {
$telerik.$('.mydiv')[0].scrollIntoView();
}, 100)
});
</script>
<div class="mydiv">
<telerik:RadButton runat="server" ID="RadButton1" Text="OpenWindow" AutoPostBack="false" OnClientClicked="ShowEditForm" />
</div>
Test Environment:
OS: Windows_11URL: https://demos.telerik.com/aspnet-ajax/window/examples/windowmanager/defaultcs.aspx
Repro Steps:
Actual Behavior:
Focus comes out of 'delete' popup without closing it automatically.
Expected Behavior:
When opening the 'delete pop-up', focus is expected to move to delete pop-up controls and focus should not leave the pop-up until it is closed. When a pop-up is opened, focus should move into that item and when it is closed, focus should return to the same control that opened it. In addition, focus should be confined to the window until the user closes it with an action, such as the close button or the ‘ESC’ key.
When the input inside RadWindow is focused the on-screen keyboard is shown, the page is scrolled so the input is into view above the keyboard and then the keyboard hides automatically. This is caused by using a RestrictionZone. Remove this property to avoid the behavior.
When a RestrictionZone is used the RadWindows are not positioned correctly in all cases. When the number of windows is low (e.g. below approximately 6) the dimensions set to the RadWindows are not optimal. In some cases not all the available viewport is filled even if the number of popups matches the needed (e.g. 6 instances should be able to cover the viewport, but they cover about 2/3 of its height).
Move the dialog after scrolling to the bottom and its content scrolls either a bit, or to the top (depending on the used browser). The scroll position must be preserved and unchanged by the RadWindow control, regardless of the circumstances
Here is a script override that can help: Telerik.Web.UI.Widgets.Draggable.prototype._calcConstraints = function (delta, position, constraints) { var $ = $telerik.$; var result = delta; //CHANGED THIS ********************************************************************************************************** //Otherwise window can't be moved all the way to the right or bottom of screen //var elementWidth = this._element.offsetWidth; //var elementHeight = this._element.offsetHeight; var elementWidth = $(this._element).width(); var elementHeight = $(this._element).height(); //********************************************************************************************************************** if ((constraints.maxX != null && position.x + elementWidth > constraints.maxX) || (constraints.minX != null && position.x < constraints.minX) || (constraints.maxY != null && position.y + elementHeight > constraints.maxY) || (constraints.minY != null && position.y < constraints.minY) ) return { x: 0, y: 0 }; if (delta.x < 0) result.x = constraints.minX !== null && !isNaN(constraints.minX) ? Math.max(delta.x, constraints.minX - position.x) : delta.x; else result.x = constraints.maxX !== null && !isNaN(constraints.maxX) ? Math.min(delta.x, constraints.maxX - position.x - elementWidth) : delta.x; if (delta.y < 0) result.y = constraints.minY !== null && !isNaN(constraints.minY) ? Math.max(delta.y, constraints.minY - position.y) : delta.y; else result.y = constraints.maxY !== null && !isNaN(constraints.maxY) ? Math.min(delta.y, constraints.maxY - position.y - elementHeight) : delta.y; return result; };
A simple workaround is to add the needed border via CSS: .RadWindow.rwNoTitleBar { padding-top: 0.5em; }
The following CSS will override the built-in rules to improve the icons positioning: div.RadWindow_Glow .rwTable .rwTitlebarControls .rwIcon { margin: 3px 5px 0 0; } div.RadWindow_Silk .rwTable .rwTitlebarControls .rwIcon { margin: 2px 5px 0 0; } div.RadWindow_Bootstrap .rwTable .rwTitlebarControls .rwIcon { margin: 6px 5px 0 0; }
Workaround in OnClientBeforeClose (commented):
<telerik:RadWindowManager RenderMode="Lightweight" OnClientClose="OnClientClose"
OnClientBeforeClose="OnClientBeforeClose" Behaviors="Close, Move, Resize,Maximize"
ID="RadWindowManager" runat="server" Width="450" Height="400">
<Windows>
<telerik:RadWindow RenderMode="Lightweight" ID="RadWindow1" VisibleOnPageLoad="true"
Title="Wikipedia" _NavigateUrl="http://www.wikipedia.org" IconUrl="wikiFavicon.ico" runat="server">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<script type="text/javascript">
function OnClientBeforeClose(oWnd, args) {
//workaround:
//oWnd.get_popupElement().style.visibility = "hidden";
}
function OnClientClose(oWnd) {
debugger;
}
</script>
This iframe element has an empty html tag that can cause issues with the Section 508 validation. Also, the iframe is not used so it does not need to be present in the markup at all. The following script added to the OnClientShow event of the RadWindowManager can remove this iframe: function OnClientShow(sender, args) { if (!sender._isPredefined) return; //check if it is a predefined dialog var frame = $telerik.$("iframe", sender.get_popupElement()); frame.remove(); }
When a RadAlert or RadConfirm is shown without an image (the last argument to their call is an empty string),the radalert/rwAlertDialog and radconfirm/rwConfirmDialog classes go missing from the control's elements (the pairs are for the Classic and Lightweight render modes respectively). Since these classes are sometimes used to cascade and apply custom styling to this dialog, their removal may be unwanted. There are several ways to work around this: - keep the image, if suitable for your case (i.e., remove the last argument from the RadAlert() call). For example: RadWindowManager1.RadAlert(text, 330, 150, "", null); - use a blank, transparent image instead of no image. It could be 1 transparent pixel (attached here). - place the desired style inline in the template. Here is an example for the Lightweight mode: <AlertTemplate> <div class="rwDialog rwAlertDialog"> <div class="rwDialogContent"> <div class="rwDialogMessage" style="font-size: 30px;"> {1} </div> </div> <div class="rwDialogButtons"> <input type="button" value="OK" class="rwOkBtn" onclick="$find('{0}').close(true); return false;" /> </div> </div> </AlertTemplate> - change the cascade to also affect the other two types of predefined dialogs. For example .rwDialogText, .rwDialogMessage { font-size: 30px; } - use a RadNotification to show the message instead: http://demos.telerik.com/aspnet-ajax/notification/examples/servershowwithnewtext/defaultcs.aspx.
Currently when external content is loaded in RadWindow, scollbars appear in the content and the control is dragged, the position of the scrollbars will be reset in IE10. The attached sample demonstrates a workaround for this issue.
When using DOCTYPE //W3C//DTD XHTML 1.0 Strict//EN and setting height to 100px RadWindow AutoResize=True gives problems in IE10 by adding unnecessary scrollbars, and in Chrome, FF and Safari the window is to high (approx. 55px too much). Refers to forum entry: http://www.telerik.com/community/forums/aspnet-ajax/window/autosize-behavior-question.aspx (I used the same sample project to replicate the problem). Please see attached screenshot and project.
I was using a RadWindowManager with PreserveClientState=True for the purpose of maintaining the size of the RadWindow following postbacks to the server (the user was allowed to resize the RadWindow). I had javascript to adjust the layout of the controls inside of the RadWindow based on the RadWindow size. Following a postback, there was no way to know when the RadWindow's size had been adjusted back to the user's setting because there are no events that indicate when the client state has been restored. I would like to request that you add an OnClientStateRestored event to the RadWindowManager so that we can execute code once the layout of the RadWindow is finalized following a postback.
Add role="button" to the anchor tags in RadAlert, RadConfirm, RadPrompt that generate the OK buttons and other buttons on these popups for 508 compliance. Currently the buttons are being announced as Links (in NVDA). Workaround is to use a line of JS/Jquery to add the role to the anchor tag.
The problem with adding such an overlay is that it cannot be transparent, or it will not work. If it is added, the content of the main page will be invisible behind a modal popup. It can be implemented via an additional property (that will default to false) should the effect be acceptable to the developer. Add a vote and/or a comment in favor or against such an option. A possible solution is setting the visibility CSS attribute of the embedded elements to hidden with a JavaScript function attached to the OnClientBeforeShow event of the RadWindow, and reverting it to its initial value with the OnClientClose hander. To ease these elements' collection they are going to use the shouldBeDisabled CSS class for this example: function OnClientBeforeShow(sender, args) { if (sender.isModal()) { var elements = $telerik.$(".shouldBeDisabled"); var arrLength = elements.length; var element; for (var i = 0; i < arrLength; i+=1) { element = elements[i]; element.style.visibility = "hidden"; } } } function OnClientClose(sender, args) { if (sender.isModal()) { var elements = $telerik.$(".shouldBeDisabled"); var arrLength = elements.length; var element; for (var i = 0; i < arrLength; i += 1) { element = elements[i]; element.style.visibility = "initial"; } } }
I'd like to send JSON (or string) object to RadWindow to be able to populate its content with this object. Similar to Value RadNotification property: public string Value { get; set; } Code snippet below illustrates what I'd like to achieve. function showWindow(jsonObject) { var windowManager = GetRadWindowManager(); if (windowManager) { var window = windowManager.getWindowByName("RadWindow1"); if (window != null) { window.DynamicContent = jsonObject; //Set content window.show(); } } return; } function RadWindow1_Show(sender, args) { var jsonObject = sender.DynamicContent; if (jsonObject != null) { var selector = null; selector = 'span[id*="Content"]'; var domElements = $telerik.$(selector); if (domElements != null && domElements.length > 0) { var spanId = domElements.attr('id'); var span = $get(spanId); if (span != null) span.innerHTML = message; } } return; }