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

[Solved] Ajax Manager getting Confused

4 Answers 214 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Alex Peachey
Top achievements
Rank 1
Alex Peachey asked on 22 May 2007, 06:32 PM
I'm having an issue on a page that has an Ajax Manager wiring up a large number of different controls. This just started happening recently, so I believe it has something to do with the current mix of controls being used. As it is currently only happening in my database driven app, I can't easily just hand over the page for testing so I'm trying to replicate in a test harness that has no DB backend.
I can isolate it to the Ajax Manager because if I remove all the AjaxSetting parameters, the page works find, although doing full post backs.
I just updated to the SP1 Promethus today in hopes it would solve it, but it did not.
So, while I work on creating a test app that replicates what I am seeing, I thought I would at least toss this out in case someone has seen something similar.
The Telerik controls in use on the page are: Prometheus (Q1-2007 SP1) RadAjaxManager, RadAjaxLoadingPanel, RadToolTip (several), RadControls  (Q1-2007 SP1) - RadInput, RadTabstrip, RadTreeView.

Now, with that background, on to the issue. What is happening is when I perform some action on the page, the AjaxManager does it's job and the action is handled via callbacks and it works fine. Then, I click on some other control to perform another action, and what I find is that instead of the event associated with that control firing and getting handled, a totally different event is fired (always the same one). If I remove the Ajax Manager, then this doesn't happen.

A more concrete example: I have an image button. When clicked, it hides a label field and exposes a text field with an accept and cancel button. If I update the information and click the accept button, then the information is updated successfully and the text field and buttons are hidden and the label is exposed again. That works fine. Now, I click on another similar setup but for a different field. This time however, instead of switching the controls around, I can see in the debugger, the SelectedIndexChanged event handler that is tied to a DropDownList I have on the page is fired. I did not change the selected index on that drop down and yet, whatever control I do click, does not fire the event associated with that control and instead fires that SelectedIndexChanged on the dropdown. It's always the same drop down (though I believe it is the first drop down on the page).

It seems like after the first successful action, the AjaxManager gets confused and has the event for the drop down tied to every other control on the page.

I know that was rather rambling and without a good example to go off of it will be hard to do much, but I thought I might not be the only one who has seen this behavior.

I'll attempt to get a test scenario together that replicates the behavior, but as the page is complicated with many controls, I'm not sure what is causing it so creating the test page has proven difficult so far. As soon as I do, I'll open a ticket with the example attached.

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 23 May 2007, 10:49 AM
Hello Alex Peachey,

Thank you for the thorough explanation on the problem. Unfortunately you are the first one to report this issue and we have no clue, what might be causing the problem. What you forgot to mention is how do you add the controls to the AjaxSettings - declarativelly or programatically? If the latter, are you doing this on Page_Load or maybe you are using the ResolveUpdatedControls event? A sample project will definitely be appreciated, and if you are having problems reproducing this, you can send us your real one along with the DB and we will do our best to advise. A NDA can be signed as well if necessary.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Alex Peachey
Top achievements
Rank 1
answered on 25 May 2007, 02:34 PM
Thanks for listening to me ramble. I spent the last couple of days trying to repeat in a test site. I finally decided to just copy the complicated page and rip out the DAL, replacing with static data items hard coded. When I finished that, I still did not see the problem. Investigating even further, I believed I narrowed the issue down to an issue with a third party control and now I appear to have fixed the problem.

0
Geoff Van Brunt
Top achievements
Rank 1
answered on 11 Jun 2007, 05:39 PM

I have a similar, but possible related issue. I have not yet filed a support ticket as I too am having trouble reproducing off page.

In my case I have some buttons that fire javacript that clicks on hidden ajaxified buttons. For example:

<span onclick="Delete();return false;">Delete</span>

this is the event that gets fired:

function Delete(){
    
window.radconfirm(
"Are you sure you want to delete this contact?", DeleteCallback, null, null, null, "Delete");
}

function DeleteCallback(returnValue){
    
if (returnValue == true){
        document.getElementById(
"DeleteButton").click();
    }
}

The DeleteButton is ajaxified by a Prometheous Ajax Manager that updates some other controls on the page. The first time I click on the "Delete" span it works fine. After a callback, clicking on the span yeilds the following error: "Object doesn't support this property or method." The debugger shows that this error is occuring on the span that launches "Delete()". The page works fine with postbacks. SP1 and the latest Public Prometheous build did fix the issue.

It's like the event is detached from the span after a callback. Unlike your case NO event gets called...

Very weird.

0
Geoff Van Brunt
Top achievements
Rank 1
answered on 11 Jun 2007, 08:46 PM
k,

Ignore all my blather above. :) As it turns out, I was naming my radWindows the same thing as the functions I was "calling from my spans" (see above code). Once I made a call to radopen the "function" was "reassigned" to the window. In addition, the delete function I showed above actually worked, so I was really off base....

Moral of the story: Don't call your radwindows the same thing as functions on your page....
Tags
Ajax
Asked by
Alex Peachey
Top achievements
Rank 1
Answers by
Steve
Telerik team
Alex Peachey
Top achievements
Rank 1
Geoff Van Brunt
Top achievements
Rank 1
Share this question
or