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

[Solved] RadAjaxManager with RadWindow

3 Answers 444 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 14 Apr 2008, 01:05 PM
I posted a ticket about this problem on 4/10, Thursday night.  I haven't received a response yet, so I thought I pose the same question to the general community to see if any other users out there might have some ideas.

I'm having a bit of trouble with a RadWindow in conjunction with radconfirm.  Here's my scenario:

  1. I have a page with a RadAjaxManager, a RadWindowManager, and 2 buttons.
  2. There's an AjaxSetting to update the RadWindowManager when the first button is pushed.  In the code-behind for the button click event, a RadWindow is created and added to the RadWindowManager and the VisibleOnPageLoad property for the RadWindowManager is set to true.  In effect, this allows me to open a window via server-side code; something I need to do because I must first save a database record before I open the window.
  3. The second button has an OnClientClick action defined that calls radconfirm.

Here's the problem:

  1. If I press button1 after the page loads, it works fine.
  2. If I press button2 after the page loads, it works fine.
  3. If I first press button1, close the window, and then press button2, I get the following javascript error "Microsoft JScript runtime error: 'this._windows.length' is null or not an object".
  4. If I disable Ajax, everything works fine.  I can press button1 or button2.  I can first press button1 and then button2.  All works fine.

If I comment out the code in the button1 code-behind, the problem still exists.  From what I can tell, the problem is not caused by the code in the button1 OnClick handler, but rather by the fact that button1 Ajax updates the RadWindowManager.

Any ideas?

3 Answers, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 14 Apr 2008, 09:23 PM
I haven't heard back from Telerik on this.  The response time is usually 24 hours with the license I have, but it's been 4 days now since I submitted my ticket through Client.Net.  I really do need an answer to this pretty soon.  I know you guys are busy, but any ideas?
0
Georgi Tunev
Telerik team
answered on 15 Apr 2008, 08:04 AM
Hello Jeffrey,

I have just answered your support ticket on the same subject. For convenience I am pasting my reply below:


First of all I would like to apologize for the delayed reply. We are extremely busy with the release of RadControls Q1 2008 which should appear later today and we are still catching up with support.

The problem in this case is that the radconfirm function tries to use the RadWindowManager which has already been disposed - when you update the RadWindowManager with Ajax, it is replaced. We will research the problem and will do our best to provide a fix for it in one of the following updates.

For the time being we can suggest to use a second RadWindowManager as a workaround. The idea is to put the second RadWindowmanager in the beginning of your page and not to update it with Ajax. The RadWindowManager's dialogs (radconfirm,radprompt,radalert) use the first rendered RadWindowManager and this way you will not experience the reported problem.


<div> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager> 
     
       <telerik:RadWindowManager ID="RadWindowManagerPOPUP" runat="server"
    </telerik:RadWindowManager> 
     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="Button1"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    </telerik:RadWindowManager> 
    <asp:Button ID="Button1" runat="server" Text="Button 1"  
        onclick="Button1_Click" /> 
         
    <%--NOTE: In my actual page, there's also an OnClick event and the version of radconfirm I'm using blocks the call to OnClick if the user presses cancel.--%> 
    &nbsp;<asp:Button ID="Button2" runat="server" Text="Button 2" UseSubmitBehavior="false" OnClientClick="return radconfirm('Test confirm?', null, 250, 150, 'Confirm?');" /> 
</div> 


Regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jeff
Top achievements
Rank 1
answered on 15 Apr 2008, 01:48 PM
Hi Georgi,

I understand.  And sorry I nagged a little.  I guessed that you might be busy with the Q1 release and might have everyone working on that.  Just wasn't used to seeing you guys so quiet ;)

For anyone who is new here, Telerik is one of the most responsive vendors out there.  And that's definitely a huge factor in the reason I picked them over other companies.  Their staff is the best.

Thanks for getting back to me.  This solution worked perfectly and will save me a lot of time.

Jeff
Tags
Window
Asked by
Jeff
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or