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

How to change Radwindow icon url form content page?

4 Answers 226 Views
Window
This is a migrated thread and some comments may be shown as answers.
Somnath
Top achievements
Rank 1
Somnath asked on 03 Aug 2011, 12:45 PM
Hi,

I want to change the current window icon url on radio button click.
i have tried that with following code but its not working .
Please suggest for the same.

 function test() {         

         var parentPage = GetRadWindow().BrowserWindow;
          var currentwindow = parentPage.GetRadWindowManager().getActiveWindow();
         var reportType =2;
         iconUrl='../images/icon2.png';

          if(reportType==1)
               currentwindow .set_iconUrl(iconUrl);    
          else if (reportType == 2)
              currentwindow .set_iconUrl(iconUrl);  
          else
               currentwindow .set_iconUrl(iconUrl);    

     }  
set_iconUrl(iconUrl);     this method is working in parent page, where radwindow is defined.

4 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 03 Aug 2011, 12:55 PM
Hello Ankit,

If you're using the GetRadWindow method, it is returning to you the RadWIndow object that the page is contained within. So you should call the set_iconUrl on that object, you don't need to get the RadWindowManager and find the active window. So you're code would look something like this:

function test() {          
  
         var currentwindow = GetRadWindow();
         var reportType =2;
         iconUrl='../images/icon2.png';
  
          if(reportType==1)
               currentwindow .set_iconUrl(iconUrl);     
          else if (reportType == 2)
              currentwindow .set_iconUrl(iconUrl);   
          else
               currentwindow .set_iconUrl(iconUrl);     
  
     }

I hope that helps.
0
Somnath
Top achievements
Rank 1
answered on 03 Aug 2011, 01:11 PM
Hi ,
I have already tried this,it is also not working.
plase suggest some alternative solution
0
Kevin
Top achievements
Rank 2
answered on 03 Aug 2011, 01:15 PM
Hello Ankit,

Can we see the page markup of your page, so we have an idea how your page looks like.
0
Accepted
Marin Bratanov
Telerik team
answered on 03 Aug 2011, 03:13 PM
Hi guys,

Please note that currently the latest event where you can change the icon of the RadWindow is the OnClientBeforeShow event, as otherwise the control's markup is already rendered and the image has been embedded firmly. We are aware of this limitation and it will be fixed for Q2 2011 SP1, which is scheduled for mid-September. For the time being you can use the following workaround to set the uconUrl of an already shown RadWindow:
var oWnd = //get a reference to the RadWindow
if (oWnd._titleIconElement)
{
    oWnd._titleIconElement.style.background = "transparent url('" + yourUrl + "') no-repeat scroll 0px 0px";
}
where yourUrl is the URL to the image you wish to use.

All the best,
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
Window
Asked by
Somnath
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Somnath
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or