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

[Solved] A bug perhaps?

1 Answer 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 11 Oct 2009, 03:39 AM
First off, this doesn't affect FF.  So far, it only affects IE 8.  I'm not sure why this is happening, but I wanted you to be aware.

SCENARIO:
I have a RadGrid with a PopUp edit form and a RadWindowManager on the page.  The PopUp edit form has an anchor that, when clicked, executes a Javascript that opens the RadWindow. Currently the Javascript is in an external file, however, I've tried it in the external source file and in the .net form <head /> as well.  Both deliver the same results.

ISSUE:
It works great the first time the anchor is clicked, however, after the RadWindow is closed, every time I click the link (whether its on the currently edited item or another), IE throws the Javascript error "The object does not support this property or method" on the line:

Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager1'document.getElementById('aspnetForm')); 

I tried both ways in opening the window:

function manageCategories() {  
    var oWnd = window.radopen("./ManageCategories.aspx""manageCategories");  

And the incorrect way (removing the RadWindowManager and opening the window directly)

function manageCategories() {  
    var oWnd = $find(PageControls.manageCategories.id);  
    oWnd.setUrl("./ManageCategories.aspx");  
    oWnd.show();      

Both throw the same error.  I've even put in a temporary "alert('hello');" command inside the function and, again, its displayed once, but every time afterwards, I get the exception.  I have to reload the page in order to "find" the manageCategories function again.

Before I give you the fix, here's additional sample code snippets:

PopUp Form Template (notice the Javascript call at the end of line 9):
                    <FormTemplate>  
                        <table cellspacing="10" style="margin-left:10px;">  
                            <tr>  
                                <td valign="top" align="right" style="width:100px;">Note: </td>  
                                <td colspan="2"><asp:TextBox ID="tbNote" runat="server" TextMode="MultiLine" Rows="6" Columns="50" Text='<%# Bind("note") %>'></asp:TextBox></td>  
                            </tr>  
                            <tr>  
                                <td valign="top" align="right" style="width:100px;">Category: </td>  
                                <td><asp:DropDownList ID="ddlCategory" runat="server" SelectedValue='<%# Bind("categoryID") %>' AppendDataBoundItems="true" DataTextField="category" DataValueField="categoryID" DataSourceID="sqlCategories" ><asp:ListItem></asp:ListItem></asp:DropDownList>&nbsp;&nbsp;&nbsp;[<a onclick="javascript:manageCategories();">Manage Categories</a>]</td>  
                                <td align="right"><asp:Button ID="btnUpdate" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Add" : "Update" %>' Width="65" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' /><asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="65" CausesValidation="false" CommandName="Cancel" /></td>  
                            </tr>  
                        </table>  
                    </FormTemplate> 

RadWindowManager:
    <telerik:RadWindowManager id="radWindowManager" runat="server">  
    <windows>  
        <telerik:RadWindow id="manageCategories" Behaviors="Close" EnableEmbeddedSkins="false" Skin="Elevate" ReloadOnShow="true" 
            Left="250px" Modal="true" Runat="server" Width="275px" Height="300px" Title="Manage Categories" ClientCallBackFunction="categoriesCallback" VisibleStatusBar="false" IconUrl="/favicon.ico" >  
        </telerik:RadWindow>  
    </windows>  
</telerik:RadWindowManager> 


FIX:
Again, the issue is, as far as I can tell, only in IE.  The only way I could fix it was to change the code:

From:
[<onclick="javascript:manageCategories();">Manage Categories</a>

To:
[<onclick="javascript:window.radopen('./ManageCategories.aspx', 'manageCategories');">Manage Categories</a>


So, instead of calling another Javascript function, I'm calling the radopen method directly.  This works in both FF and IE.

It seems that somehow IE is losing the manageCategories function after the radWindow has been opened and closed once.

Don't know, but hopefully this solution may help others and again, pinpoint a small bug?

Thanks guys.
Joshua

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 13 Oct 2009, 12:18 PM
Hello Joshua,

I don't think this issue is related to the RadWindow control - as you have noticed, even if you put a simple alert in the JavaScript function, the problem still occurs. Are you using Ajax for outputting the script? It will be best if you open a support ticket and send us a sample project where this issue could be reproduced so we could investigate further.



Sincerely yours,
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
General Discussions
Asked by
Joshua
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or