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

postback when using radWindow

3 Answers 151 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
mac
Top achievements
Rank 1
mac asked on 25 Jul 2008, 02:27 AM
hi.
I am using the following demo as a guideline for creating records in a window and then sending the data back to the parent page
http://www.telerik.com/support/kb/article/b454K-tee-b454T-cec-b454c-cec.aspx

The demo works as it should. However an issue comes up when I have other controls on the parent page that get populated prior to calling the radwindow()

For eg, if you run the demo out of the box, but add a radDateTime picker to the parent, you will note that each time the closeAndReload() is called, it will clear the values in the parent... this is the culprit I am thinking. 
 oWnd.BrowserWindow.location.reload();  

I got around this by using an ajax manager. Now however I get the usual IE warning that the page has data and needs to be reposted.. Anyone know a way to get around this issue or understand what I mean?

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 28 Jul 2008, 06:40 AM
Hello mac,


Basically oWnd.BrowserWindow.location.reload(); is equal to pressing F5 on the parent page - that is why you experience this behavior.

To keep the values that you have entered in inputs on the parent page, you need to send them to the server somehow - this is a general ASP.NET task. You can find more information on how to call a server-side function via Javascript in various places in the Net (the asp.net forums are a good place to start). For example you can use __doPostBack() or RadAjax's ajaxRequest call to do this. Once you choose the approach that suits your requirements, you can hook to RadWindow's OnClientClose eventhandler and call the code there.



Sincerely yours,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
anu
Top achievements
Rank 1
answered on 07 Aug 2008, 02:30 PM
I came across the same situation and could find a solution. I know its too late to give reply, but better late than never!!

function
CloseAndReload()
{
var oWnd = GetRadWindow();
// oWnd.BrowserWindow.location.reload();
oWnd.BrowserWindow.location.href=oWnd.BrowserWindow.location.href
oWnd.Close();
}


reload makes more sense though but href is the one that works!!

0
Svetlina Anati
Telerik team
answered on 07 Aug 2008, 02:44 PM
Hello guys,

The window.location.reload method can be used for reloading the page, but I suppose that you have left with the impression that it does not reload the page. This happened because you have called it without parameter - window.location.reload(). In this case, the method is executed with its default value - false - and the page is reloaded from the browser cache - that is why the changes have not been applied.

You can find more information about the full syntax of the method here.

Best wishes,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
mac
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
anu
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or