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

Problem with VisibleStatusBar en DestroyOnClose

5 Answers 59 Views
Window
This is a migrated thread and some comments may be shown as answers.
Hans van Rijnswoud
Top achievements
Rank 2
Hans van Rijnswoud asked on 18 Mar 2009, 09:01 AM
Hi,

I try to fix these probleme since a time ( try to find a solution in this forum or in the documentation) but nothings works.

My scenario is the following:

I load inside a RadWindow an Aspx to upload picture. When the picture is uploaded i show a message to confirm the upload ( i play with asp panel).
When the user close de RadWindow, i take the argument from the close function and i update with ajax the picture in the ascx.
So far, so good. it's work perfect.

But if i want to upload a new picture, when i click on the link to open the RadWindow, the RadWindow don't make a reload of the aspx but i have the last state of the page ( the confirmation message)

I try to implement DestroyOnClose ( int the RadWindowManager and /or in the RadWindow) but without effect.

Here is my code:

function OpenUpload(_url) { 
        var oWnd = radopen(_url, "RadWindow_Logo"); 
        oWnd.add_close(OnClientClose); 
    } 
 
    function OnClientClose(oWnd, args) { 
        var arg = oWnd.argument; 
        if (arg) { 
            var fileName = arg
            var hid_input = document.getElementById('<%=hid_PictureName.ClientID %>') 
            if (hid_input != null) { 
                hid_input.value = fileName
            } 
         
            var btn = document.getElementById('<%=btn_updatePicture.ClientID %>') 
            if (btn != null) { 
                btn.click(); 
            } 
        } 
    } 
 
 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
                            <href="javascript:OpenUpload('Upload.aspx?Id=<%=UserSession.GetCompanyIdFromCustomerUser()%>&UploadType=Logo')">Upload een nieuw logo</a> 
                        </telerik:RadCodeBlock> 
                        <telerik:RadWindowManager ID="RadWindowManager_logo" runat="server" Skin="Office2007"
                            <Windows> 
                                <telerik:RadWindow ID="RadWindow_Logo" runat="server" Height="200px" Width="300px" Left="600" 
                                Top="200" VisibleOnPageLoad="false" Behavior="Close" OnClientClose="OnClientClose" VisibleStatusbar="false"  DestroyOnClose="true" EnableViewState="false"  /> 
                            </Windows> 
                        </telerik:RadWindowManager> 


Another problem is that i don't want to see the statubar of the RadWindow. VisibleStatusBar is on false but without effect.


Your help would be appreciate!

Thanks,

Edwin.



5 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 18 Mar 2009, 11:41 AM
Hi Edwin,

Try removing the DestroyOnClose property and set the following ones:
ShowContentDuringLoad=false
ReloadOnShow=true


See how your app will behave after that. If the problem still exists, please open a support ticket and send me a small sample project that I could run locally and check.

As for the problem with the VisibleStatusBar property, this effect comes from the DestroyOnClose one that you have set to true. When DestroyOnClose=true and RadWindow is closed, its object is destroyed as well. This means that you will not be able to open that same RadWindow again until the page is reloaded (i.e. the RadWindow object is created again). If you call radopen before that, a new RadWindow will be opened with the default settings taken from the RadWindowManager.


Best wishes,
Georgi Tunev
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Hans van Rijnswoud
Top achievements
Rank 2
answered on 18 Mar 2009, 12:10 PM
Hi Georgi

Thanks for this quick answer.
I try your advise but it don't work.
I have also the same problem with the StatusBar visibility.
I use this RadWindow in different page and i have the same problem.

I will try to prepare a little project for you and send it with a support ticket.

Thanks,

Edwin.
0
Georgi Tunev
Telerik team
answered on 18 Mar 2009, 12:46 PM
OK Edwin,

I will expect your project and will check it right away.


Kind regards,
Georgi Tunev
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Hans van Rijnswoud
Top achievements
Rank 2
answered on 18 Mar 2009, 02:16 PM
Hi Georgi,

I just send a support ticket ( nr: 198538)

Thanks,

Edwin.
0
Georgi Tunev
Telerik team
answered on 18 Mar 2009, 03:31 PM
Hi Edwin,

Thank you very much for the project - it helped me to quickly find the reason for the problems with RadWindow. I have forwarded your support ticket to the RadTabStrip team for your 3rd issue and they will answer you as soon as possible.
Here is my reply from the ticket regarding the problems with RadWindow:


Both RadWindow problems occur because you have 2 RadWindowManagers on the page - one in Vacancy.aspx and one in ProfilGeneral.ascx. When working in such environment you need to have the following in mind:
  1. All RadWindoManager functions (radalert, radprompt, radconfirm and radopen) are always using the RadWindowManager that is first rendered on the page.
  2. A RadWindowManager "recognizes" only the RadWindows that are declared in its WIndows collection.
What happens in your scenario is that you call radopen(), but because the RadWindow_Logo window is in the other RadWindowManager (being rendered second on the page), the first RadWindowManager automatically creates a new RadWindow with such ID that uses the default settings from the first manager.
To avoid problems like this, when having multiple RadWindowManagers on the page, I recommend not to use radopen() but to get a reference to the corresponding RadWindow by using the ASP.NET AJAX $find() method and open it by using show(). e.g:
function OpenUpload(_url) { 
     
    //var oWnd = radopen(_url, "RadWindow_Logo"); 
    var oWnd = $find("<%= RadWindow_Logo.ClientID %>");  
    oWnd.setUrl(_url); 
    oWnd.add_close(OnClientClose); 
    oWnd.show(); 

As for the "reload" issue itself, if you set ReloadOnShow=true and ShowContentDuringLoad=false for the RadWindowManagers, you should not experience it anymore.



Kind regards,
Georgi Tunev
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Hans van Rijnswoud
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Hans van Rijnswoud
Top achievements
Rank 2
Share this question
or