We have a RadComboBox that is being loaded on demand with values as the user types (similar to the search assist with a google web search).
When a user hits enter or clicks a button to perform their search while the data is still being loaded, we are getting a modal error message window in Firefox that states: "The server method 'GetCompletionList' failed." 'GetCompletionList' is the name of our webservice method. This only happens in Firefox and only happens when the ajax request to load data is aborted.
We attempted to cancel the OnClientItemsRequestFailed event of the combo box but found the event was not being raised in this case.
Our combo box is in a user control on a master page. Here is the code for the combo:
Here is the js we are using:
Can you please provide a work around or solution? Thanks.
When a user hits enter or clicks a button to perform their search while the data is still being loaded, we are getting a modal error message window in Firefox that states: "The server method 'GetCompletionList' failed." 'GetCompletionList' is the name of our webservice method. This only happens in Firefox and only happens when the ajax request to load data is aborted.
We attempted to cancel the OnClientItemsRequestFailed event of the combo box but found the event was not being raised in this case.
Our combo box is in a user control on a master page. Here is the code for the combo:
<telerik:RadComboBox ID="ddlTextSearch" runat="server" AllowCustomText="True" EnableLoadOnDemand="True" |
ShowDropDownOnTextboxClick="False" ShowToggleImage="False" onclientitemsrequesting="ddlTextSearch_ItemRequesting" OnClientSelectedIndexChanged="ddlTextSearch_SelectionChanged" ZIndex="9900"> |
<WebServiceSettings Method="GetCompletionList" Path="~/TextSearchAutoComplete.aspx" /> |
</telerik:RadComboBox> |
Here is the js we are using:
function ddlTextSearch_HandleKeyPress(e) |
{ |
if (!e) e = event; |
var keyCode = e.keyCode || e.which; |
if (keyCode == 13) |
{ |
var combo = $find("<%= ddlTextSearch.ClientID %>"); |
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); |
if (combo && combo.get_highlightedItem() != null) |
{ |
ajaxManager.ajaxRequestWithTarget("<%= ddlTextSearch.UniqueID %>","<%= WebUtils.HttpRequestEventArguments.SearchAssist %>"); |
} |
else |
{ |
ajaxManager.ajaxRequestWithTarget("<%= ddlTextSearch.UniqueID %>","<%= WebUtils.HttpRequestEventArguments.Search %>"); |
} |
} |
} |
// Telerik workaround for enter key when ddl is loading. |
var $ = $telerik.$; |
$(document).ready(function(){$("#" + "<%= ddlTextSearch.ClientID %>" + "_Input").keydown(ddlTextSearch_HandleKeyPress);}); |
// Telerik workaround for not selecting cell text when clicking on txtbox. |
Telerik.Web.UI.RadComboBox.prototype._onInputCellClick = function(e) |
{ |
if (this._enabled) { |
// if (this.get_text() !== this.get_emptyMessage()) |
// this.selectText(0, this.get_text().length); |
if (!this.get_dropDownVisible() && this._showDropDownOnTextboxClick) |
this._showDropDown(e); |
return true; |
} |
} |
function ddlTextSearch_SelectionChanged(sender, eventArgs) |
{ |
if (eventArgs.get_domEvent().type == "click") |
{ |
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); |
if (ajaxManager) |
{ |
ajaxManager.ajaxRequestWithTarget("<%= ddlTextSearch.UniqueID %>","<%= WebUtils.HttpRequestEventArguments.SearchAssist %>"); |
} |
} |
} |
function ddlTextSearch_ItemRequesting(sender, eventArgs) |
{ |
var context = eventArgs.get_context(); |
/* Setting a few context parameters - code removed */ |
} |
Can you please provide a work around or solution? Thanks.