Hello,
Since upgrading from 19.4.50 to 19.4.52 the SfDropdown component is completely broken when using a CustomDataAdaptor and an OnActionComplete handler.
Read is only called once on the DataAdaptor no matter what you type into the component. Please use the code below to reproduce the issue. If you type the letter "s" into the dropdown, Read is correctly called. If you then type "m" or anything else for that matter, Read is NOT called. Even if you delete all of the text and type "s" again, Read is not called.
<div id="ControlRegion">
<SfAutoComplete TValue="string" TItem="Order" Query="@Query" EnableVirtualization="true">
<SfDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></SfDataManager>
<AutoCompleteFieldSettings Value="@nameof(Order.OrderID)" Text="@nameof(Order.CustomerID)"></AutoCompleteFieldSettings>
<AutoCompleteEvents TValue="string" TItem="Order"
OnActionComplete="@ActionCompleteHandler">
</AutoCompleteEvents>
</SfAutoComplete>
</div>
@code{
public Query Query = new Query().Take(20);
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public int EmployeeID { get; set; }
public int ShipVia { get; set; }
}
/// <summary>
/// Once the data is retrieved from the API set _defItem to the exact code match if there is one otherwise the first
/// record in the list
/// </summary>
/// <param name="args"></param>
protected void ActionCompleteHandler(ActionCompleteEventArgs<Order> args)
{
System.Console.WriteLine("ActionCompleteHandler");
}
public class CustomAdaptor : DataAdaptor
{
// Performs data Read operation
public override object Read(DataManagerRequest dm, string key = null)
{
System.Console.WriteLine(string.Format("ReadAsync skip{0} take{1} requires count {2}", dm.Skip, dm.Take, dm.RequiresCounts));
System.Console.WriteLine(string.Format("Where count {0}", dm.Where == null ? 0 : dm.Where.Count));
return new List<Order>{ new Order() { OrderID = 1, CustomerID = "Sam Smith", EmployeeID = 1, ShipVia = 1 },
new Order() { OrderID = 2, CustomerID = "John Smith", EmployeeID = 2, ShipVia = 1 }};
}
}
}
Could you please fix this urgently because we can't make use of the other fixes in 19.4.52 due to this new bug.
Thanks,
Chuck
Hi Sureshkumar,
Since upgrading to 19.4.53 I can confirm this issue is fixed.
Thanks for the speedy turnaround,
Chuck