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

Opening a popup shows previously opened data for a second !?!

7 Answers 298 Views
Window
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 03 Dec 2008, 02:08 AM

I've got a RadGrid, and when double-clicking on a row, client-side javascript kicks in by openning up a pop-up Window:

 

 

function ShowEditForm2(id, rowIndex)

 

{

 

    ....
                var oWnd = window.radopen("AddConsultant2.aspx?consultantid=" + id, "EditDialog"); 
                oWnd.SetSize(650,400);
    ....
}

I can close this pop-up window, then go ahead and open it up again by double-clicking on another row back on the RadGrid.

This is all working fine, however I notice that the second time (and subsequent times after the second time) the pop-up window is openned, it will display the data from the previously openned instance (just for a second). Then immediately the correct data on the pop-up window gets rendered. This is somewhat annoying; is there a way to 'refresh' this? It seems to cache the display.

7 Answers, 1 is accepted

Sort by
0
Brad
Top achievements
Rank 1
answered on 04 Dec 2008, 12:38 AM
Hello...?
0
Georgi Tunev
Telerik team
answered on 04 Dec 2008, 01:56 PM
Hello Brad,

Try setting ShowContentDuringLoad to false and ReloadOnShow to true. This should produce the desired effect.


Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Serrin
Top achievements
Rank 1
answered on 04 Dec 2008, 02:00 PM
I also tried setting the RadWindowManager DestroyOnClose to true, that made it appear to load a fresh page every time.  Although I'd trust Georgi's method more than my findings. :)
0
Georgi Tunev
Telerik team
answered on 04 Dec 2008, 02:41 PM
Hello again,

Serrin, thank you your confidence in me ;)
I see that my reply was a bit too short, so I hope that the information below will be shed some light on this issue.

Basically, by design when a RadWindow is closed, its object is not destroyed - the window remain hidden on the page. This is done in order to provide a caching feature so the window could come up fast when called again.
In some scenarios however you need to show a new version of the content page every time RadWindow is called. In such case, you can use different approaches depending on the specific scenario:
  1. Use ReloadOnShow=true and ShowContentDuringLoad=false. This way RadWindow will reload the page every time it is shown, but because ShowContentDuringLoad is set to false, users will not see the old version of the page.
  2. Use DestroyOnClose=true. When this property is set, the window object is destroyed once RadWindow is closed. Note however, that in such scenario, you will not be able to open the same RadWindow again untill the whole page is reloaded. That is why if you set DestroyOnClose to true, you will need to either use the client-side API to control the RadWindow look and behavior every time you open it (setSize(), setUrl(), set_modal() etc.), or to set all the needed properties in the RadWindowManager's declaration.
  3. Hook to the OnClientClose eventhandler and change the Url of the RadWindow when it is closed. Set the Url again when you open the window.
I hope this helps.


Best wishes,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bram van den Broek
Top achievements
Rank 1
answered on 08 Dec 2008, 08:45 AM
Hello Georgi,

I have had the same issue, but if you set ShowContentDuringLoad="false" the radwindow will not open in the correct screen size after opening. It will first open as a smaller window (correct height and narrower width) and than resize to the actual user defined window size.

With kind regards,

Bram
0
Georgi Tunev
Telerik team
answered on 08 Dec 2008, 02:51 PM
Hi Bram,

I am not familiar with such problem and I was not able to reproduce it locally. Could you please open a support ticket and send me a project where this behavior could be reproduced? I will check it right away.


Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Billy
Top achievements
Rank 1
answered on 07 May 2015, 08:12 PM
SAME ISSUE! The above was not helpful.
Tags
Window
Asked by
Brad
Top achievements
Rank 1
Answers by
Brad
Top achievements
Rank 1
Georgi Tunev
Telerik team
Serrin
Top achievements
Rank 1
Bram van den Broek
Top achievements
Rank 1
Billy
Top achievements
Rank 1
Share this question
or