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

opening different styled windows

5 Answers 64 Views
Window
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 16 Dec 2010, 11:54 PM
Up till now, I have used a single radwindowmanager in my application (in a masterpage).The RadWindowManager specifies the skin to be used for all popup dialogs throughout my application, I open similarly-styled windows using:

windowObject.radopen(url, name)

...where "windowObject" determines which "frame" to open the window from (ie window, top, parent, etc.)


Some new application requirements dictate that I need to be able to open dialogs in more than one styled window. My understanding is that, to accomplish this, I need to add a second RadWindowManager to my pages (please let me know if there is a more straightforward method of doing this). The second RadWindowManager has a different id and skin. Now, when I want to open a popup using this second style, I just get a reference to the second RadWindowManager and use:

oManager2.open(url, name);

This works fine, except the issue I am running into is that i'm not sure how to open the window from the correct "frame" anymore using this windowmanager .open syntax. I need to specify the frame because sometimes I have windows that are opened from within other windows, and I need to be able to specify whether the window should open on top, or within the frame of the parent window.

5 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 20 Dec 2010, 02:10 PM
Hi Albert,

Indeed, your approach (to get a reference to the corresponding RadWindowManager and call its open() method) is correct. Depending on your scenario, you can use standalone RadWindow controls (with different skins) as well.
As for your exact scenario however, I am not sure that I understand it completely, so I would like to ask you to open a support ticket and to send me a sample project where I can observer the problem that you are facing. This way I will get a better view over your case and I will be able to provide you with the most appropriate solution.


Best wishes,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 20 Dec 2010, 03:10 PM
Before I take the step of creating a sample project, I think I might be able to pose my question in a simple way so you understand. Let's say I have a splitter with a left and rigth pane. If I have a page which loads in the right pane, and I want a rad window opened from this page to be "on top" of the entire splitter and not only the within right pane, then I use syntax like:

parent.radopen(url, name)

Now, if I have two WindowManagers set up and I get a reference to the particular one I want to use.... how do I open the window in the "parent" window container from the right splitter pane? The syntax for opening a window using the windowmanager doesn't seem to allow the addition of the container as it does in radopen:

oManager2.open(url, name);

0
Svetlina Anati
Telerik team
answered on 20 Dec 2010, 03:26 PM
Hello Albert,

The new RadWindow will be opened in the context of the page which has the RadWindowManager declared on it and this is the case when using the parent as well. That is why what you should do is the following:

1) Declare the desired RadWindowManagers on the main page
2) Reference the needed manager from the other document and call radopen as shown below:

var wndMng = window.top.$find("MyManager");
if(wndMng) wndMng.open(url, "MyWindow");

The keyword top always refers to the top of the frame tree (the main page in your case). 

3) Note that all the above, including having frame tree is true only when you load an external document in the RadWindow. If you are using ContentTemplate, all the content is on the same page and calling simply radopen will also work.

I hope that my reply is detailed enough and helpful, let me know if you need further assistance or additional questions.
 

Best wishes,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 20 Dec 2010, 04:06 PM
Am I correct in assuming I can also use widow.parent.$find instead of window.top.$find? Sometimes I have RadWindow within RadWindow scenarios so I may be looking for an intermediate container as opposed to window or top.

Also, one related question. The original response to this thread mentioned the use of multiple Rad Windows with different skins instead of multiple Rad Window Managers. Everything being equal, I would think this method would be better since it probably loads less content on the page. When using radopen, I usually specify null for the windown name. This has been because, in the past, this was necessary to make sure the new opened window did not cache its content. I don't recall whehter this was a bug or no. I do notice that you now nclude a random querystring parameter to all pages opened in radwindow, and I assume this is so the loaded page content is not cached. Does this mean I can name the window without issue? And if so, can you let me know how I get a reference to the particular radwindow I want to pbe opened, using radopen or manager.open?

For example, let's say I have a single windowManager with two windows defined, each with a different skin and Id ("Win1" and "Win2"). Could I sumpl;y use "Win1" and "Win2" in the "name" parameter of the radopen function?
0
Svetlina Anati
Telerik team
answered on 23 Dec 2010, 01:23 PM
Hi Albert Shenker,

 Straight to your questions:


1) Yes, you could use window.parent or GetRadWindow().BrowserWindow syntax as well as top, depending on your exact scenario and requirements.

2) The problem with cached content comes from specific IFRAME behavior under IE and thus it is not a bug in RadWindow. This can be resolved by destroying the RadWindow object or better - by uisng the random query string as you have noted. To enable this behavior you should set ReloadOnShow="true".

3) Once you have declared your RadWindows you can open them as follows:
   
    - if you have declared them in a window manager, you can simply pass the ID to the radopen method as follows:
   
       radopen(url, "MyRadWindow"); or myWindowManager.open(url,"MyRadWindow")  

Note, that in case of more then one managers you should use the second syntax to be sure that the manager you want is in use.

   - if you have declared them individually, you can reference them by using $find and show(), e.g as follows:

      window.top.$find("myWindow").show();

Kind regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Window
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Georgi Tunev
Telerik team
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Svetlina Anati
Telerik team
Share this question
or