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

Wrong RadWindow is opened

2 Answers 48 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ivy
Top achievements
Rank 1
Ivy asked on 15 Feb 2013, 02:18 AM
Hello,

In my project, i have added multiple RadWindowManager in one aspx page and the issue is, Sometimes a different RadWindow is opened apart from the expected one. How to rectify this issue?

Thanks in advance,
Ivy.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 Feb 2013, 04:43 AM
Hi Ivy,

You are experiencing this strange behavior because of the presence of more than one RadWindowManager on the same page. Sometimes a call to radopen() opens a RadWindow with unexpected settings or a different one when a page contains more than one RadWindowManager.

The RadWindowManager is designed to work as a singleton - i.e. only one instance per page. The radopen() (and radalert(), radconfirm(), radprompt() functions as well), being global functions, are attached to the first instance that is created on the page, which may result in some unexpected behavior if other managers are present as well - the RadWindow with the given ID (the second argument passed to the function) needs to be in the Windows collection of the targeted manager, otherwise a generic one with the settings from the first manager will be opened.

This particular issue can be resolved by the following appraches.
Get a reference to the RadWindowManager which you want to use via $find("DesiredRadWindowManagerClientID") and use its own open() method.

Javascript:
var oWnd = $find("<%=RadWindow1.ClientID%>");
oWnd.setUrl('MyPage.aspx');
oWnd.show();

Another approach is like You can directly open the desired RadWindow via $find("RadWindowClientID") and call its show() method. Also try to move all the RadWindows you use to the single RadWindowManager.

Thanks,
Princy.
0
Ivy
Top achievements
Rank 1
answered on 15 Feb 2013, 04:44 PM
Thank you pricy for your clear explanation. The issue is solved by following the approach you mentioned.
Tags
Window
Asked by
Ivy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ivy
Top achievements
Rank 1
Share this question
or