The error I get is this:
Line: 1218
Error: 'length' is null or not an object
Thank you in advance,
Chris Salas
9 Answers, 1 is accepted
Kind regards,
Simon
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.
<telerik:RadComboBox ID="radCBABA" runat="server" Width="125px" EnableLoadOnDemand="true" DropDownWidth="300px" ShowMoreResultsBox="false" ShowToggleImage="false" EnableVirtualScrolling="false" |
WebServiceSettings-Method="GetCompletionListTelerik" WebServiceSettings-Path="AutoCompleteABA.asmx"></telerik:RadComboBox> |
<WebMethod()> _ |
Public Function GetCompletionListTelerik(ByVal context As Telerik.Web.UI.RadComboBoxContext) As Telerik.Web.UI.RadComboBoxData |
Dim comboData As New Telerik.Web.UI.RadComboBoxData() |
If context.Text.Length >= 3 Then |
Dim tmpDS As DataSet = GetData(context.Text, 30) |
Dim data As Data.DataTable = tmpDS.Tables(0) |
Dim itemOffset As Integer = context.NumberOfItems |
Dim endOffset As Integer = Math.Min(itemOffset + 30, data.Rows.Count) |
comboData.EndOfItems = endOffset = data.Rows.Count |
Dim result As New Generic.List(Of Telerik.Web.UI.RadComboBoxItemData)(endOffset - itemOffset) |
For i As Integer = itemOffset To endOffset - 1 |
Dim itemData As New Telerik.Web.UI.RadComboBoxItemData() |
itemData.Text = data.Rows(i)("ABANumber").ToString() & " - " & data.Rows(i)("BankName").ToString() |
itemData.Value = data.Rows(i)("ABANumber").ToString() |
result.Add(itemData) |
Next |
comboData.Message = GetStatusMessage(endOffset, data.Rows.Count) |
comboData.Items = result.ToArray() |
Return comboData |
Else |
Return comboData |
End If |
End Function |
Here is the code that I am using within the Web Service. I copied and modified the code from the example on the Demo site. When debugging the site it never hits the method.
Regards,
Simon
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.
I added the code you suggested and still get the same error. Could this be happening because I have the RadComboBox within an AjaxControlToolKit Tab Panel?
Thanks,
Chris
Simon,
The issue has been resolved. I was setting the WebServiceSetting-Path incorrectly. Thank you for your help.
Chris Salas
All the best,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I'm also getting the errror Error: 'length' is null or not an object when calling a WCF service from the RadComboBox.
The result I get is :
{"d":{"__type":"RadComboBoxData:#Telerik.Web.UI","_context":[],"_endOfItems":true,"_items":[{"__type":"RadComboBoxItemData:#Telerik.Web.UI","_attributes":[{"Key":"Id","Value":"444c0bfd-3cb4-4b79-894a-9d0600d0b235"},{"Key":"Name","Value":"Frank Herbert"},{"Key":"BirthDate","Value":"\/Date(-1553655600000+0300)\/"},{"Key":"BirthCity","Value":"Tacoma, WA"}],"_enabled":true,"_text":"Frank Herbert","_value":"444c0bfd-3cb4-4b79-894a-9d0600d0b235"},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","_attributes":[{"Key":"Id","Value":"f6f0a80e-0484-42d9-be48-9d0d00fe1360"},{"Key":"Name","Value":"Jerome K Jerome"},{"Key":"BirthDate","Value":"\/Date(-3492385200000+0300)\/"},{"Key":"BirthCity","Value":"Walsall, Staffordshire"}],"_enabled":true,"_text":"Jerome K Jerome","_value":"f6f0a80e-0484-42d9-be48-9d0d00fe1360"},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","_attributes":[{"Key":"Id","Value":"3feda487-e146-4597-941e-9d280096fa49"},{"Key":"Name","Value":"Jules Verne"},{"Key":"BirthDate","Value":"\/Date(-2139876000000+0200)\/"},{"Key":"BirthCity","Value":"Paris"}],"_enabled":true,"_text":"Jules Verne","_value":"3feda487-e146-4597-941e-9d280096fa49"},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","_attributes":[{"Key":"Id","Value":"fb21fc6b-8688-4b7f-89c5-9d280098220f"},{"Key":"Name","Value":"Alexandre Dumas"},{"Key":"BirthDate","Value":"\/Date(-2153098800000+0300)\/"},{"Key":"BirthCity","Value":"Paris"}],"_enabled":true,"_text":"Alexandre Dumas","_value":"fb21fc6b-8688-4b7f-89c5-9d280098220f"},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","_attributes":[{"Key":"Id","Value":"76b83732-122f-43b8-bcd0-9d28009849dc"},{"Key":"Name","Value":"Orson Scott Card"},{"Key":"BirthDate","Value":"\/Date(-1516500000000+0200)\/"},{"Key":"BirthCity","Value":"New York"}],"_enabled":true,"_text":"Orson Scott Card","_value":"76b83732-122f-43b8-bcd0-9d28009849dc"}],"_message":"Items <b>1<\/b>-<b>5<\/b> out of <b>5<\/b>","_numberOfItems":0,"_text":"","_value":""}}
So , the wcf service is called, it returns data.
Don't actually know why the message above is a bit different from the one from the demo wich has upper case letters instead of underscores :
{"d":{"__type":"RadComboBoxData:#Telerik.Web.UI","Context":[],"EndOfItems":false,"Items":[{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Alejandra Camino","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Alexander Feuer","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Ana Trujillo","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Anabela Domingues","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"André Fonseca","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Ann Devon","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Annette Roulet","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Antonio Moreno","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Aria Cruz","Value":""},{"__type":"RadComboBoxItemData:#Telerik.Web.UI","Attributes":[],"Enabled":true,"Text":"Art Braunschweiger","Value":""}],"Message":"Items <b>1<\/b>-<b>10<\/b> out of <b>91<\/b>","NumberOfItems":0,"Text":"","Value":""}}
Could this be a problem ? If it is why ? My WCF service is configured as in the RadComboBox LoadOnDemand WCF sample.
Thank you
Kind regards,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.