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

Radwindow + MDI + Focus OnClientActivate

1 Answer 59 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rodrigo
Top achievements
Rank 1
Rodrigo asked on 13 Sep 2012, 07:14 PM
Hello,

Im trying using radwindow as mdi, until now its works fine, but when i open multiple windows and when i click on other window, i cant put focus on fisrt element of the window activated, the focus stays in any textbox on last window.

Sry for my english, because im brazilian learning english.

Tnks.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 14 Sep 2012, 11:19 AM
Hi Rodrigo,

The RadWindow loads external pages in an iframe, which is the only way to achieve such functionality in HTML. This means that in some cases the page will be from a different domain so we cannot access it via JavaScript due to the standard browser cross-domain restrictions. Moreover, we do not know which element should get focus when a RadWindow is activated, or even if an element should be, which is why we cannot incorporate this logic in the control.

Nevertheless I can suggest a way to achieve the desired behavior - attach to the OnClientActivate event and use the RadWindow's client-side API to get a reference to the content page (get_contentFrame() method) or content element if you are using its ContentTemplate (get_contentElement() method). In case you load an external page this help article will show you how to call a function inside. Then you can use jQuery to find an element inside and call its focus() method. This element can have a custom CSS class, e.g. .defaultFocusElement so you can get it easily.


All the best,
Marin Bratanov
the Telerik team
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 their blog feed now.
Tags
Window
Asked by
Rodrigo
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or