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

[Solved] Radcombo javascript error in WebResource.axd

3 Answers 138 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Penny
Top achievements
Rank 1
Penny asked on 19 Jun 2008, 03:02 PM
I'm pretty new to radcontrols and Ajax in general, so I'll try to be as thorough as possible in describing the scenario, but if you need more information please let me know.

Scenario:

I have an ASP textbox and a radComboBox that are both managed with a RadAjaxManager. Both controls are set up to update each other in the AjaxManager. The textbox has an TextChanged event handler that calls a function to load the radCombo, and the radCombo has an ItemsRequested event handler that also loads the combo.

the RadCombo is set with the following properties:
AppendDataBoundItems = true
AutoPostBack = true
EnableLoadOnDemand = true
MarkFirstMatch = true

The code in both the function called from the textbox textchanged event, as well as in the radCombo ItemsRequested event, makes a SQL server database call to retrieve the data for the combo.

We have entered text into the textbox control and then we click on the dropdown image of the RadCombo. We then see the "loading" message and then we receive a Javascript error:
this.Items.length is null or not an object.

After debugging, we found that the Items attribute is null. Does anyone have a possible resolution?

3 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 20 Jun 2008, 06:33 AM
Hi Penny ,

You will need to set the Combo and the TextBox as updated control in both the AJAX settings. Please, give it a go and let us know if it helps. If you still need our assistance, please see if disabling AJAX (Manager's EnableAJAX="false") resolves the problem.

Sincerely yours,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Rick Hewitt
Top achievements
Rank 2
answered on 20 Jun 2008, 05:32 PM
(From Penny:)

I don't want to turn off Ajax in AjaxManager. It resolved the problem, but negated the use of AjaxManager altogether. Is there a way to void this error without turning off AjaxManager?

I discovered the Javascript error only occurs when I set focus using the AjaxManager FocusControl method in any of the text-changed events in code-behind. When I remove the FocusControl method from a text-changed event and click the radCombo from inside that textbox, I don't get the error.

I think it may have something to do with event stacking. Is there some other way of setting focus on Ajax-managed controls after controls are updated?
0
Konstantin Petkov
Telerik team
answered on 23 Jun 2008, 12:54 PM
Hello Penny,

Setting focus of ajaxified control indeed requires the FocusControl call. I suppose this is the correct way of focusing the required controls in your situation.

Would you please isolate the error in a sample runnable application and send it through a regular support ticket, started from your Client.NET account? We will gladly review it, investigate the problem and get back to your with our findings.

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Penny
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Rick Hewitt
Top achievements
Rank 2
Share this question
or