Completed
Last Updated: 06 Jun 2019 14:59 by ADMIN
Release R2 2019
Anthony
Created on: 02 Apr 2019 00:43
Category: ListView
Type: Bug Report
1
ListView: [Android] When using TemplateSelector sometimes the items are displayed with the wrong content

Hi,

On Android, I am using a DataTemplateSelector and a DataTemplate that has a switch on it that the user can press. When the user presses the switch the ListView starts corrupting the data in the list. The item being interacting with starts appearing in other locations on the list.

This issue can be reproduced in the Telerik SDKBrowser project.

Select the following : ListView -> Cell Types -> Template Cell Selector - Xaml

Mark Item1 as special using the button. Scroll down and you will see that an item in the list has been replaced by Item 1 which is now in the list twice.

Regards

Anthony

 

7 comments
ADMIN
Didi
Posted on: 06 Jun 2019 14:59
Hi Anthony,

Thank you for the provided project.

I have tested it and I reproduced the issue. The issue occurs when Singleton ViewModel is used. I have logged this on your behalf in our Feedback portal and you could follow the item on the link below:
https://feedback.telerik.com/xamarin/1412179-listview-android-exception-is-thrown-when-singleton-viewmodel-is-used

Please find your Telerik points updated as a small sign of gratitude for your involvement.

Solution:

At this time, I could suggest you use one of the following approaches:

1)  do not use a singleton viewmodel - refer to the App.xaml.cs file from the attached project. 

2) clear the collection -uncomment the code inside the PassenderSingletone.cs file and inside the PersonContentPageViewModel.cs.

I have attached the modified project for reference.

Note: Please if you want to report a new issue I suggest you to open a new Feedback item for a support ticket. I am asking about this because the Title of this Feedback item is related to another issue. 

Regards,
Didi
Progress Telerik
Attached Files:
Anthony
Posted on: 04 Jun 2019 04:25

Hi,

I have the crash with Telerik UI for Xamarin 2019.2.513.1 and 2019.2.603.1 . The Xamarin.Forms version is 3.6.0.264807.

I have attached a sample app that exhibits the crash.

Press on the List button, toggle some switches, navigate back, press the List button again, toggle a switch, crash.

Regards

Anthony 

Attached Files:
ADMIN
Didi
Posted on: 28 May 2019 12:49
Hello Anthony,

Thank you for the provided stack-trace and description.

Could you please give us the following information:

- version of Telerik UI for Xamarin and Xamarin.Forms used in the project?
- sample app where the issue could be reproduced. 

Looking forward to your reply.

Regards,
Didi
Progress Telerik
Anthony
Posted on: 21 May 2019 22:58

Hi,

The reported issue has been fixed but I am now getting a crash in Telerik code (see below for stack trace).

To reproduce this crash is slightly more complex than the original issue because it only happens when the ListView shows different data the second time you view it. I will explain further using two scenarios:

Scenario 1, does not crash:

Navigate from main menu to child screen showing list 1 of objects.

Swipe switch on ListView item.

Navigate  back to main menu.

Navigate from main menu to child screen showing list 1 of objects.

Swipe switch on ListView item.

Scenario 2, crash:

Navigate from main menu to child screen showing list 1 of objects.

Swipe switch on ListView item.

Navigate  back to main menu.

Navigate from main menu to child screen showing list 2 of objects.

Swipe switch on ListView item. Crash

If I null the variable in my ViewModel that the page BindingContext is pointing to before I navigate back to the main menu the crash does not happen. It seems like the ListView is somehow still firing internal events on old data unless this is cleared?

Thanks

Anthony 

  

05-22 08:41:56.347 I/MonoDroid(10831): System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
05-22 08:41:56.347 I/MonoDroid(10831):   at Telerik.XamarinForms.DataControls.RadListView+<>c__DisplayClass125_0.<OnItemsSourcePropertyChanged>b__0 (System.Object sender, System.ComponentModel.PropertyChangedEventArgs eventArgs) [0x0000d] in <54bca44b8fc84b77a4760736d165085c>:0
05-22 08:41:56.347 I/MonoDroid(10831):   at Telerik.XamarinForms.DataControls.ItemsSourceWatcher.<AddPropertyChangedListener>b__7_0 (Telerik.XamarinForms.DataControls.ItemsSourceWatcher listener, System.Object sender, System.ComponentModel.PropertyChangedEventArgs eventArgs) [0x0000a] in <54bca44b8fc84b77a4760736d165085c>:0
05-22 08:41:56.347 I/MonoDroid(10831):   at Telerik.XamarinForms.Common.WeakEventListener`3[TListener,TEventSource,TEventArgs].OnEvent (System.Object sender, TEventArgs eventArgs) [0x00023] in <4164515d6fbe493ba6368ab0a3de92cc>:0
05-22 08:41:56.357 I/MonoDroid(10831):   at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs) 

ADMIN
Didi
Posted on: 05 Apr 2019 15:16
Hi Anthony,

I understand this issue affects your working process.

I can assure you that I have logged it with high priority and I have escalated it to our developer team. The severity of the issue comes from the native Android ListView control and it makes it more complex. At this point I could not commit a time-frame when a possible fix for the issue could be provided. Please follow the item in order to receive an email notification as soon as there is any progress on it. 

Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Anthony
Posted on: 04 Apr 2019 21:07

Hi,

As this is a bug that makes the control unusable, is there an estimated time this might be fixed?

Regards

Anthony 

ADMIN
Didi
Posted on: 03 Apr 2019 15:02
Hi Anthony,

Thank you for the provided information.

I have tested the scenario and I reproduced the issue with the RadListView TemplateSelector.  I have converted this forum thread into a public bug report, so you could easily track its status. I am afraid that I cannot suggest a feasible workaround to this issue.

You can find your Telerik points updated as a small sign of gratitude for your involvement.

Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items