Bugs found while implementing SfPicker in our app

Hi.Please find here a list of bugs we have found when implementing the SfPicker control.three of them were already opened as separate tickets,but have not been included in the last update,number 16.2.0.50(Nuget package version). Syncfusion very much became part of our app since we purchased it and we would need to know when these bugs can be fixed.In case they can not be reproduced probably the best way would be to do some kind of demo to clarify them.
Please see the list and some of them have screenshots attached:
We use code for defining the UI, not xaml. PickerMode is set to Dialog for all issues shown below.Picker is opened in each case after we click on a button.
1.
prerequisites:pickermode.dialog is set,picker with one column
issue:binding of a viewModel property to the SelectedItem bindable property throws an exception(happening both on Android and iOS) - see "Ex1-SelectedItemBindablePropertyException.png".
repro steps:have a picker in dialog mode => bind to SelectedItemProperty => exception is thrown when trying to present page(exception is thrown not when the binding is defined,
but when the page is pushed to the navigation stack).
workaround:In order to be able to use the picker,we bind to the picker's selectedIndex,and use a converter to retrieve from the itemSource the needed index.
2.
prerequisites:pickermode.dialog is set,picker with one column(https://www.syncfusion.com/forums/139157/selecteditemproperty-binding-throws-exception-on-android-if-it-is-set-twice)
issue: setting the selectedItem property of the picker to a value throws an exception on Android(it works on iOS) - see "Ex2-SelectedItemAssignmentException.png"
repro steps:have a picker in dialog mode on Android => set an itemsSource => when I click on the button to open the picker,so on the button.clicked eventhandler,first I try to select the currently stored value
in the viewModels backing property as this: picker.SelectedItem = viewModel.SelectedValue.This action will throw an exception.
workaround:use picker.SelectedIndex
3.
prerequisites:pickermode.dialog is set,we don't dispose our pages,instead we keep them in memory and use them again when we need them instead of recreating them each time(ex: builder.RegisterType().SingleInstance();)
3a. timePicker with 2 columns,pickermode is dialog
issue: on both Android and iOS the pickers throw an exception when we try to set the selectedItem,the 2nd time we try to show the page(so first time all is good,when we try
to access it again,an exception is thrown). - see "TimePickerSelectedItem.png"
repro steps:open a page with TimePicker,open picker by clicking on the timePickers button,close page,try to reopen page => exception will be thrown
workaround:we dispose of the pickers each time we close a page,and receate it each time we get the new page again on the OnAppearing function
3b.single column picker,pickermode is dialog
issue: on iOS we have the same issue with single column pickers as well,weirdly on Android only the ItemsSource needs to be set each time we access an already acessed page(see 3c)
repro steps:open a page with single column picker on iOS,open picker by clickin on the pickers button,close page,try to reopen page => exception will be thrown
workaround: same as on 3a example,we dispose the pickers when we close the page,recreating it when we reopen the page.
3c.any picker,pickermode is dialog.
issue: on Android the list is empty after we access the page for the 2nd time onwards - see "AndroidItemsNotVisible.png"
workaround: we need to refresh on OnAppearing the binding to the backing collection,by setting a new binding between the ItemsSource bindable property to the viewmodel property
4.
prerequisites:pickermode.dialog is set,picker is a timePicker as described in your guide
issue:when I try to set the selectedItem of the timePicker,I need to set it as ObservableCollection<object> on Android,and ObservableCollection on iOS,otherwise one of them is not set properly. - see "TimePickerSelectedItem.png"
repro steps:open page with timePicker, click on the button to open timePicker , on ButtonClickedEvent try to set the timePicker.selected item as ObservableCollection or ObservableCollection<object> and you will notice it will work only on one platform
workaround : treat differently the Android and iOS scenarios as described in the issue
5.
prerequisites:pickermode.dialog is set,picker a single column picker,
issue: when hooking up to the OkButtonClickedEvent,the SelectionChangedEventArgs' NewValue property on ios comes initially(only first time) as an object, afterwards as a collection of objects
repro steps:open page with picker,click on button to open picker,hit the ok button,open picker again,modify selection,hit the ok button. Note that first time the selection comes as an objhect string,then as a collection of objects
workaround: (e.NewValue as Collection<object>)?[0] as string ?? e.NewValue as string
6.
prerequisites:pickermode.dialog is set,any kind of picker (https://www.syncfusion.com/forums/139158/can-i-disable-background-touch-on-sfpicker-in-dialogmode)
issue: When the picker is open in dialog mode, background touch is not disabled or there is no property to disable it
as far as I understood ,you said you will include this in a later release.
workaround:we use a bool not to let commands execute while the picker is open
7.
prerequisites:picker is set to picker.DialogMode,timepicker with 2 columns(https://www.syncfusion.com/forums/139036/itemssource-change-on-ios)
issue:cannot replace minuteValue collection on iOS
workaround:we found no workaround here,we are waiting for your fix

Attachment: SfPickerBugs_d938751f.rar


1 Reply

PA Paul Anderson S Syncfusion Team September 5, 2018 01:00 PM UTC

Hi Tamas, 
 
 
Sorry for the inconvenience caused. 
 
 
No  
Response 
Query 1 
We tried to reported issue “exception is thrown not when the binding is defined, but when the page is pushed to the navigation stack” is not reproduced from our side in both android and iOS. We have prepared a sample, in which the Main page as the picker control and it will be in the navigation stack when we navigate to the MainPage from OpenPage. The SelectedItem property binding works correctly. Please find the sample from the below link 
  
Sample: Page 1 
 
Please check our sample and if the issue persists in your side please modify our sample to replicate the issue. So that we can give appropriate solution for the reported issue. 
Query 2 
We are able to reproduce the reported issue “setting the SelectedItem property of the picker to a value throws an exception on Android” in 16.2.0.50 version. The reported issue is already fixed in the current implementation and the fix will be available in the upcoming volume 3 Release.  
Query 3.a 
We are unable to reproduce the reported issue “on both Android and iOS the pickers throw an exception when we try to set the SelectedItem, the 2nd time we try to show the page(so first time all is good, when we try access it again, an exception is thrown).” from our side. Please find the sample from the below link 
  
Sample: Picker 3 Page 
Query 3.b 
We are unable to reproduce the reported issue “on iOS we have the same issue with single column pickers as well, weirdly on Android only the ItemsSource needs to be set each time we access an already accessed page” from our side. Please find the sample from the below link. 
 
Sample: Picker 3 Page 
Query 3.c 
We are unable to reproduce the reported issue “on Android the list is empty after we access the page for the 2nd time onwards - see "AndroidItemsNotVisible.png" from our side. Please find the sample from the below link 
  
Sample: Picker 3 Page 
Query 4 
We are able to reproduce the reported issue “setting the selectedItem property of the picker to a value throws an exception on Android” in 16.2.0.50 version. The reported issue is already fixed in the current implementation and the fix will be available in the upcoming volume 3 Release. 
Query 5 
We are able to reproduce the reported issue “when hooking up to the OkButtonClickedEvent,the SelectionChangedEventArgs' NewValue property on ios comes initially(only first time) as an object, afterwards as a collection of objects” in 16.2.0.50 version. The fix will be available in the upcoming volume 3 Sp1 Release. 
Query 6 
The fix for the reported issue is not included in the volume 3 release and the fix will be available in the upcoming volume 3 Sp1 Release. 
Query 7 
We tried to reproduce the reported issue” cannot replace minuteValue collection on iOS” from side. But we are unable to reproduce the reported issue in Xamarin.Forms iOS. We have prepared a sample, in which we will remove the column and add the new collection to the second column by clicking the ok button in the picker. By clicking the cancel button we will again remove and add the older collection to the second column. Please find the sample from the below link 
  
Reproducing step: 
  1. Click the Go to Picker 7 Page
  2. Click the button to Open the Picker
  3. Click the ok button to add the new collection to the second column
  4. Again, Click the button to Open the Picker
  5. Click the cancel button to add the old collection to the second column
 
  
 
Note: 
In the provided sample, we have prepared each picker for each query in different pages. Please check our sample and if the issue persists in your side please modify our sample to replicate the issue. So that we can give appropriate solution for the reported issue.  
 
Regards, 
Paul Anderson 


Loader.
Up arrow icon