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

problem with redwindow

6 Answers 58 Views
Window
This is a migrated thread and some comments may be shown as answers.
Azadeh
Top achievements
Rank 1
Azadeh asked on 11 Jul 2011, 04:26 PM
I have a stupid problem with RedWindow. In my App I open a RedWindow to show som einformation to users. And users Can change the and save it after that, or just click cancel button. When users click save button, I want to reload parent page. But if they click Cancel button, I don't want to refreshing parent.

This is my code:
In parent I have : 

<telerik:RadWindowManager ID="rwmMain" runat="server" EnableShadow="true">
           <Windows>
                <telerik:RadWindow ID="DataEntry" runat="server" Title="Data Entry"                    
                    DestroyOnClose="true" OnClientClose="closeModal" ReloadOnShow="true" Width="870" />
            </Windows>
 </telerik:RadWindowManager>

And This is my "closeModal" method:
function closeModal(sender, eventArgs) {
    var arg = eventArgs.get_argument();
   if (arg != 'close')
  {
            window.location.reload(true);
        }
}

Now, if I just open redwindow and click save button parent will be refresh, and for cancel button, the parent doesn't refresh. but the problem happens when I open redwindow and click on Cancel button, and after that opening redwindow again and this time click save button, the parent doesn't refresh. 

6 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 12 Jul 2011, 11:02 AM
Hello Azadeh,

At this point I would suggest to clear the argument once it is used:
function closeModal(sender, eventArgs)
{
    var arg = eventArgs.get_argument();
    if (arg != 'close')
    {
        window.location.reload(true);
    }
    arg = null;
}

If this doesn't help, I will need the code of the parent and the content page that is related to the RadWindow control, so I can get a better view over your exact logic.


Best wishes,
Georgi Tunev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Azadeh
Top achievements
Rank 1
answered on 12 Jul 2011, 01:50 PM
I tried to clear the argument once it is used, but it doesn't work.
I can solve the problem by closing the radwindow from client side. But I face to another problem, and this time, my redwindow just load for a first time and it doesn't reload again and just shows old data.

function clientCloseModalWithArg(arg) {
    GetRadWindow().close(arg);
 if (arg != 'close')
  {
            top.location.reload(true);
        }

arg=null;
}

<telerik:RadWindowManager ID="rwmMain" runat="server" EnableShadow="true">
           <Windows>
                <telerik:RadWindow ID="DataEntry" runat="server" Title="Data Entry"                    
                    DestroyOnClose="true"  ReloadOnShow="true" Width="870" />
            </Windows>
 </telerik:RadWindowManager


0
Azadeh
Top achievements
Rank 1
answered on 12 Jul 2011, 01:55 PM
You know, It seems when the parent reload, the radwindow reload too, And when the parent doesn't refresh the radwindow doesn't reload and just show window with old data.
0
Azadeh
Top achievements
Rank 1
answered on 12 Jul 2011, 07:17 PM
Hey,

   I really need your help. Is there any way to destroy radwindow from client side?
0
Georgi Tunev
Telerik team
answered on 13 Jul 2011, 11:09 AM
Hi Azadeh,

Try removing the DestroyOnClose property from the RadWindow's declaration and clear the argument in the parent page (in the closeModal() function)

Greetings,
Georgi Tunev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Azadeh
Top achievements
Rank 1
answered on 13 Jul 2011, 03:38 PM
Thanks, I removed the DestroyOnClose property, and Now it works well :).

Thank you so much. 

Tags
Window
Asked by
Azadeh
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Azadeh
Top achievements
Rank 1
Share this question
or