How to save autocomplete value from edit page to db?

Hello,

I have a autocomplete in an edit page and when I change the value it doesn't bind it to the current table field. I can select the value from the autocomplete but the value that gets sent is the original value rather than the changed value. How can I accomplish this?

Thanks,
Jatin

Hi @jbhakta,

There appears to be a problem with the Autocomplete which we need to fix. I will update this thread when the fix is ready.

I'm not sure if this is related to your team trying to fix this but, now I don't even get the possible values to choose from in the autocomplete window, despite having them returned in JSON.

Hi @jbhakta,

We will investigate this as well. Hopefully the fix will be ready tomorrow.

Thank you for your understanding!

Radzen 2.25.3 just released with fix for this problem.

Hello,

After updating I get the following when typing into the autocomplete.

image

The returned JSON does show values, though I am not able to get them to show in the autocomplete window still. Yet alone to choose a value and save to db.

image

Here are my properties values: NOTE: DisplayName is a NotMappedProperty of Product and registered in OnConfigureOnData in Startup.cs
image

image
I've tried to set "Value" to ${getProductResult} but that just resulted in the following:

image

What needs to be done?

Thanks,

You need $filter for the invoke and in Then you can set ${event.data = result.value}


https://angular.radzen.com/auto-complete

Ah yes, needed to set event.data to get it to display in autocomplete window. But, I'm not able to save the new value still. I want a way for the Text Property to be "DisplayName" and the value to be "ProductId" and this value changed in db table when changed/submitted. Also, having the "DisplayName" that's passed in as default. How can I achieve this?

Here's what I was thinking but this won't update the "ProductId"

You want to search by name however save the Id? This is not supported by AutoComplete component - you will need DropDown with filtering.

Yes. I would use the DropDown with filtering but for this data, there are many results (hundred thousands) returned that it doesn't load in DropDown if I use this component. Thus, I want to use AutoComplete so it only returns say 40 or so of related data.

You can use DropDownDataGrid in this case - you can filter and page server side.