We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamically load data with multi-select

Thread ID:

Created:

Updated:

Platform:

Replies:

145667 Jul 3,2019 04:43 AM UTC Jul 4,2019 01:25 PM UTC Xamarin.Forms 3
loading
Tags: SfAutoComplete
Alex
Asked On July 3, 2019 04:43 AM UTC

I am trying to create a multi-select SfAutoComplete that queries a REST API as the user types.

I have this semi-working for a single item, but there is a fatal flaw when using multi-select and tokens...

I have tried two options to capture a user's input. One is using the "ValueChanged" event to trigger a call to my REST API, and another is 2-way databinding the "Text" field and then using the setter to trigger the REST API call.

For example, I can search for the name "Alex" from a list. I type "Alex" and it shows that suggestion from my API. I select it, and it adds this token to the typing area of the AutoComplete. The problem is, this triggers ValueChanged as well as the "Text" setter. It tries to make another call to my API with the full text of the typing area.

Muneesh Kumar G [Syncfusion]
Replied On July 3, 2019 11:53 AM UTC

Hi Alex, 
 
Greetings from Syncfusion.  
 
In AutoComplete, whenever a selection is made from the dropdown or type the text in the editor we have updated SfAutoComplete Text property and raised the ValueChanged event. We suggest you to call your Rest API any of these one place. 
 
We have checked the reported issue "Fatal flaw when using multi-select and tokens when using REST API" from our side.  We need more detail about your application to analyze this issue further. So, could you please provide the simple sample based on your application which replicates the reported issue. 
 
This will be helpful for us to investigate further and provide you a better solution at the earliest. 
  
Regards,  
Muneesh Kumar G.    


Alex
Replied On July 3, 2019 05:22 PM UTC

Here I have provided an example that just searches iTunes API for track names.

To reproduce:
  1. Type the name of a popular song like "Hello"
  2. The ValueChanged event will fire every time you type a character and query iTunes
  3. Select a result from the suggestions
  4. The ValueChanged event will fire again because you've changed the value of the textbox
  5. The token will be removed for some reason
  6. Even if the token stayed, if I want to type a second name, like "All Time", the value I get in "ValueChanged" will now be "HelloAll Time". 
The problem is that the "Value" contains what you're typing as well as existing token's text. This means I can't capture the value of what someone is typing without having to manually strip out the other tokens.

Attachment: AutoCompleteTest_ad9bef7e.zip

Muneesh Kumar G [Syncfusion]
Replied On July 4, 2019 01:25 PM UTC

Hi Alex, 
 
We have checked the attached sample and we would like to let you know that the tokens have been cleared since when the results are being cleared in the following method LoadResultsAsync. Hence, we have removed the same and attached the sample. 
 
 
And also when the next item is clicked the Value we got is the current text in the autocomplete. We have recorded a video from which we incurred the solution. Please have the video link, 
 
 
Please check with the video and if the mentioned behavior differs from the video please, provide a video representation which will be helpful for us to analyze further and provide an appropriate solution. 
 
Regards, 
Muneesh Kumar G.  
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon