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

set_iconUrl() client side not setting the icon on a new window.

5 Answers 180 Views
Window
This is a migrated thread and some comments may be shown as answers.
Lance
Top achievements
Rank 1
Lance asked on 27 Sep 2009, 02:51 AM
Hello,
I have an aspx form with a window manager on there, and I am opening new windows client side based on user action.  When the window is created, I want to set a custom icon that may be different depending on what the user clicked (Search, Edit Customer, Edit Order, New Order, etc...).  The windows are opening fine, and the iconUrl is set, because I retrieve it later, and show it in a listing of open windows.  However, only the default icon appears in the window's title.  Am I missing a call or something to tell it to refresh the title bar? 

Thanks in advance.
Lance


I am using the following code to open the windows.
                function OpenWindow(url, id, iconUrl)  
                {  
                    var wnd = $find(id);  
                    if (!wnd)  
                    {  
                        wnd = window.radopen(url, id);  
                        if (iconUrl)  
                        {  
                            wnd.set_iconUrl(iconUrl);  
                        }  
                    }  
                    else 
                    {  
                        wnd.show();  
                    }  
                    return false;  
                } 

5 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 28 Sep 2009, 08:11 AM
Hello Lance,

You should first set the IconUrl and then to open the window.
for example:

<form id="form1" runat="server"
<asp:ScriptManager ID="ScriptManager1" runat="server"
</asp:ScriptManager> 
<script type="text/javascript"
    function openWin() 
    { 
        var oWnd = $find("<%= RadWindow1.ClientID %>"); 
        oWnd.set_iconUrl("http://www.mass.gov/massgov2/images/rss/feed-icon.jpg"); 
        oWnd.show(); 
    } 
 
</script> 
<telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="RadConfirmCSSSize.aspx"></telerik:RadWindow> 
<button onclick="openWin(); return false;">test</button> 
</form> 


Regards,


Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Lance
Top achievements
Rank 1
answered on 28 Sep 2009, 04:12 PM
Hi,
The solution works if I have a Window Control on the page, but I do not.  I have a WindowManager, and I am creating the windows on the fly.  The ones that are controls on the page work, but the dynamic ones do not. 

Is there a preferred work around for this case? 
0
Georgi Tunev
Telerik team
answered on 29 Sep 2009, 03:45 PM
Hello Lance,

The RadWindowManager does not support such functionality out of the box, but you could use an internal method to achieve the desired result.


function openWin() 
    var oWnd = radopen("Dialog.aspx""MyRadWindow"); 
    oWnd.set_iconUrl("http://www.mass.gov/massgov2/images/rss/feed-icon.jpg"); 
    oWnd._titleIconElement.style.background = "transparent url('http://www.mass.gov/massgov2/images/rss/feed-icon.jpg') no-repeat scroll 0px 0px"
}  



All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tejas Shah
Top achievements
Rank 1
answered on 04 Dec 2009, 06:38 PM
We have an .aspx page with multiple radconfirm on it. We want to change icon (Question Mark) on Telerik Confirm with custom image on certain Radconfirm and not all. Is that possible?

doing this way changes all radconfirm.
<style type="text/css">
        .RadWindow .rwWindowContent .radconfirm
        {
            background-image: url('../../images/stop.gif');
            background-position: left top;
        }
    </style>

Thanks
0
Georgi Tunev
Telerik team
answered on 07 Dec 2009, 11:07 AM
Hi Tejas,

Please check this forum thread - I believe it will be of help.

 


Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Window
Asked by
Lance
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Lance
Top achievements
Rank 1
Tejas Shah
Top achievements
Rank 1
Share this question
or