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

"window.open" is not working using radtooltipmanager control

1 Answer 107 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Bader
Top achievements
Rank 1
Bader asked on 26 Apr 2011, 09:30 AM
PHello,

I have a problem in opening a window form after opening the radtooltipmanager..
Please view the webpage http://israel-jewelry-center.com/Pages/Categories/Bracelets.aspx. By coming over any item, a radtooltipmanager opens, and by clicking the big image, a radwindow opens.
The requirements is to change the radwindow control with a window (using the javascript command window.open). 
I added the following code to the Bracelets.aspx page:
function CloseActiveToolTipAndOpenUrl(path) {
            setTimeout(function () {
                var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
                if (tooltip) {
                    tooltip. hide();
                    window.open(path, "mywindow", "status=1");
                }
            }, 1000);
             
        }

But unfortunatily, just the command tooltip.hide() is executed, but the window.open(path, "mywindow", "status=1") didn't.
I dont understand why is that.

Please download the sample application from http://www.israel-jewelry-center.com/ToolTipSampleApplication.rar 

Please, I need your help,
It is appreciated to send me the modified code with an explaination,

Regards,
Bader

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 29 Apr 2011, 09:00 AM

Hello Bader,

You sample is not runnable and I had to take out all database-related calls.

That aside here are a few suggestions:

  • The ToolTip is a client object, you should work with it on the client-side, because after the postback of the button there might be no active tooltip and thus the window.open() function inside the if statement will not be called
  • Attaching the CloseActiveToolTipAndOpenUrl() function to the client click event of the image button successfully opens a new browser window as you can see in the demo from my test: .
  • I would recommend setting a RelativeTo property of the RadToolTipManager
  • There are two RadWindowManagers with the same id - one in the user control and one in the main page. This might cause some issues so I would recommend changing one of them, or removing the irrelevant one since you are not going to be opening a RadWIndow, but a browser window.
  • The easiest way to pass the required URL from the code-behind (as this is your scenario) is to use the AjaxPanel's response scripts and change the value of a global variable

For your convenience I modified your page to do that. You can find it attached.



Regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
ToolTip
Asked by
Bader
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or