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

Rad Window within Tab page

3 Answers 42 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jacques
Top achievements
Rank 1
Jacques asked on 21 Jan 2009, 03:52 PM
I have a RadWindow within a user control within a tabbed page. When the tab containing the radwindow is clicked a javascript error occurs stating that the onClose function cannot be found. The identical code used in a control and not in a tab works.

If EnableAjax="False" is set within the RadAjaxManager on the parent page no javascript error is generated and the window appears when the link is clicked.

Any suggestions as to how to get rid of the javascript error when EnableAjax="True" on the parent page.

Thanks

Jac

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 21 Jan 2009, 04:03 PM
Hi Jacques,

To be able to help, I will need to have a better view over your exact setup and code logic. Please open a support ticket and send me a small sample project where this problem can be reproduced - just make sure that the project can be run locally and attach it to the support thread. I will check it and get back to you with a solution.


All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jacques
Top achievements
Rank 1
answered on 21 Jan 2009, 04:48 PM

Hi Georgi

Found a workaround which will have to do for now due to tight delivery schedule. I will open a ticket as soon as I get a chance to put a sample project together

 

I noticed that if the tab with the window and function was displayed on the initial load of the page that the problem did not occur. Regrettably we did not want this tab as the first. I Copied the onClose javascript function to the initial tabbed page being displayed. I removed everything from the body of the function.

No more javascript error and the window appears when the link is clicked.

Jacques

 

0
Georgi Tunev
Telerik team
answered on 22 Jan 2009, 11:03 AM
Hi Jacques,

It is good to know that you managed to find a workaround - send me a sample with the original problem when you have time and I will check it thoroughly.
By the way, from your explanations it seems that the problem is happening because when a RadWindow is created on the page, the function set in the OnClientClose property is still not present. If you want you can try to add the function dynamically with JavaScript only when needed - for example when opening the window.
e.g.
function openWin() 
    var oWnd = radopen("mypage.aspx","myRadWindowID");  
    oWnd.add_close(ClosingFn);  
 
function ClosingFn(oWnd) 
    //your code here 
    oWnd.remove_close(ClosingFn); //make sure that the function will be added only once when a RadWindow is opened.  


Regards,
Georgi Tunev
the Telerik team

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