sfAutoComplete for iOS is not working with a List from the viewModel

Thanks a lot for you help,

i'm using  sfAutoComplete in our project, i have an observableCollection<MyModel> in my PageViewModel,

ObservableCollection<GeneralPractitioner> _DoctorsList = new ObservableCollection<GeneralPractitioner>() {

       new GeneralPractitioner(){FirstName ="000000000000"},

        new GeneralPractitioner(){FirstName ="22222222222"},

        new GeneralPractitioner(){FirstName ="3333333333333"},

        new GeneralPractitioner(){FirstName ="44444444"},};

        public ObservableCollection<GeneralPractitioner> DoctorsList

        {

            get

            {

                return _DoctorsList;

            }

            set

            {

                _DoctorsList = value;

                UpdateProperty(nameof(DoctorsList));

            }

        }


<autocomplete:SfAutoComplete

                                x:Name="autoComplete"

                                DataSource="{Binding DoctorsList}"

                                HeightRequest="40"

                                MinimumPrefixCharacters="2"

                                SelectedItem="{Binding Path=SearchFilter.SelectedDoctor}"

                                ShowBorder="False"

                                Watermark="{helpers:Translate SEARCH_DOCTOR}">

                                <autocomplete:SfAutoComplete.Behaviors>

                                    <helpers:EventToCommandBehavior Command="{Binding DoctorSearchTextChangedCommand}" EventName="ValueChanged" />

                                </autocomplete:SfAutoComplete.Behaviors>

                                <autocomplete:SfAutoComplete.ItemTemplate>

                                    <DataTemplate>

                                        <StackLayout Padding="2,0,0,0" Orientation="Horizontal">

                                            <Label

                                                Text="{Binding Path=FirstName}"

                                                VerticalOptions="Center"

                                                WidthRequest="500" />

                                        </StackLayout>

                                    </DataTemplate>

                                </autocomplete:SfAutoComplete.ItemTemplate>


                            </autocomplete:SfAutoComplete>


in Android, it work perfectly, but in iOS it does not ( the listview of the autocomplete does not show anything ) .


but if for IOS, i set the list in the xaml like this, it works perfectly.

        <autocomplete:SfAutoComplete x:Name="autoComplete"
                                     HeightRequest="40">
            <autocomplete:SfAutoComplete.AutoCompleteSource>
                <ListCollection:List x:TypeArguments="x:String">
                    <x:String>India</x:String>
                    <x:String>Uganda</x:String>
                    <x:String>Ukraine</x:String>
                    <x:String>Canada</x:String>
                    <x:String>United Arab Emirates</x:String>
                    <x:String>France</x:String>
                    <x:String>United Kingdom</x:String>
                    <x:String>China</x:String>
                    <x:String>United States</x:String>
                    <x:String>Japan</x:String>
                    <x:String>Angola</x:String>
                </ListCollection:List>
            </autocomplete:SfAutoComplete.AutoCompleteSource>
        </autocomplete:SfAutoComplete>


i will be fetching the data from the web api.


4 Replies

SS Suganya Sethuraman Syncfusion Team May 21, 2021 12:29 PM UTC

Hi Wabu,

Greetings from Syncfusion.

We have analyzed the reported issue. we have prepared a sample based on the provided code snippet, but we were unable to replicate the issue.

Please have a sample,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/AutoCompleteSample-1060922667

Since we are not aware of exact scenario of the issue, could you please check the issue with the attached sample and let us know whether it is reproduced or not? If the issue was not reproduced in this sample, please revert us by modifying the sample based on your application along with replication procedure or provide the runnable sample.  This will be helpful for us to investigate further and provide you a better solution at the earliest.

Regards,
Suganya Sethuraman.
 



KA kamini May 23, 2023 11:55 AM UTC

Hi


Sir, Sfautomcomplete is not working with ItemTemplate in IOS. How can you not reproduce that i don't understand. 



AJ AhamedAliNishad JahirHussain Syncfusion Team May 24, 2023 02:15 PM UTC

Hi Team,

 

We have reviewed your query, and it seems that the issue with the dropdown items not being shown when using ItemTemplate in iOS for the AutoComplete control. This issue occurs only when the DisplayMemberPath property is not set. We have created a sample in which the AutoComplete control is populated with data and the DisplayMemberPath property is set. Now, the issue is resolved, and the dropdown items are displayed correctly. Please review the sample and let us know the details.

 

Regards,

Ahamed Ali Nishad.


Attachment: AutoLinebr_(3)_96a04337.zip


MA Marcel June 2, 2023 11:40 AM UTC

I tried the latest example and have to say it is still not working in iOS (v16.4)


Loader.
Up arrow icon