BUG: Error Using SelectionInput on Android with Enterprise

1 reply. Last post: August 25, 2015 4:43 AM by Arief Handany
Tags :
  • (None)
Bug Submission
  • New Discussion
  • New Question
  • New Product Feedback
Jimmy TungolMember
Product Name
Crosslight
Product Version
1.0.5000
Build Version
290
Status
Open
Importance
Normal
Browser
    Operating System
    • Windows 8.1 x64
    NET Version
    • .NET Framework 4.5
    Dev. Environment
    • Microsoft Visual Studio.NET 2013
    Dev. Stage
    • Development

    Description


    Error is being encountered when using SelectionInput with Android, which is not being experienced on iOS using the same ListViewModels.

    Step to Reproduce

    Use a selection with deep navigation properties.

    [Editor(EditorType.Selection)]
    [SelectedItemBinding(Path = "Machine.Class")][SelectionInput(SelectionMode.Single, DisplayMemberPath = "ClassName", ListSourceType = typeof(ClassListViewModel))] [Binding(Path = "Machine.Class.ClassName")] public static Class Class;


    And here's the ListViewModelBase... we decided to use ListViewModelBase because USING DataListViewModelBase creates more issues with this scenario.

        public class ClassListViewModel
            : ListViewModelBase<Class>
        {
            #region Field Variables
    
            private IQueryDefinition f_ViewQueryDefinition;
    
            #endregion
    
            #region Properties
    
            /// <summary>
            /// Gets the repository.
            /// </summary>
            /// <value>The repository.</value>
            public IClassRepository Repository
            {
                get
                {
                    return Container.Current.CanResolve<IClassRepository>() ? 
                        Container.Current.Resolve<IClassRepository>() : 
                        new ClassRepository(null);
                }
            }
    
            /// <summary>
            /// Gets the view query.
            /// </summary>
            /// <value>The view query.</value>
            public IQueryDefinition ViewQuery
            {
                get
                {
                    if (this.f_ViewQueryDefinition == null)
                        this.f_ViewQueryDefinition = new ClassQueryDefinition();
    
                    return this.f_ViewQueryDefinition;
                }
            }
    
            /// <summary>
            /// Initializes the select parameter used when loading data.
            /// </summary>
            /// <returns>The select parameter.</returns>
            /// <param name="queryDescriptor">Query descriptor.</param>
            protected virtual SelectParameter InitializeSelectParameter(QueryDescriptor queryDescriptor)
            {
                var parameter = new SelectParameter(queryDescriptor);
    
                return parameter;
            }
    
            #endregion
    
            #region Methods
    
            public async override void Navigated(NavigatedParameter parameter)
            {
                this.ActivityPresenter.Show("Loading...", ActivityStyle.SmallIndicatorWithText, true);
    
                var p_SourceItems = await this.Repository.GetAllAsync(this.InitializeSelectParameter(this.ViewQuery.GetQueryDescriptor()));
    
                this.Items = p_SourceItems.Items.OrderBy(p => p.ClassName);
    
                this.ActivityPresenter.Hide();
    
                base.Navigated(parameter);
            }
    
            #endregion
        }


    Actual Result

      --- End of managed exception stack trace ---
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
        at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
        ... 2 more
    Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.InvalidOperationException: Source object must implement INotifyPropertyChanged to support OneWay or TwoWay binding mode.
    at d.RefreshPropertyPath () <IL 0x002cd, 0x00d43>
    at d..ctor (Intersoft.Crosslight.BindingContext) <IL 0x00014, 0x00083>
    at Intersoft.Crosslight.BindingContext..ctor (object,Intersoft.Crosslight.BindableProperty,Intersoft.Crosslight.BindingDescription) <IL 0x0001f, 0x000d7>
    at Intersoft.Crosslight.ObjectExtensions.SetBinding (object,Intersoft.Crosslight.BindableProperty,Intersoft.Crosslight.BindingDescription) <IL 0x00003, 0x00063>
    at Intersoft.Crosslight.Android.Views.FormComponentBase.ConfigureBinding (Android.Views.View,Intersoft.Crosslight.BindableProperty,Intersoft.Crosslight.Forms.BindingAttribute,Intersoft.Crosslight.BindingDescription) <IL 0x0003c, 0x0013b>
    at Intersoft.Crosslight.Android.Views.FormComponentBase.PrepareBinding () <IL 0x00058, 0x001a6>
    at Intersoft.Crosslight.Android.FormActivity`1<Mercury.Mobile.Core.ViewModels.Collection.TicketMachineEditViewModel>.OnCreate (Android.OS.Bundle) <0x0032b>
    at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1978/f98871a9/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.App.Activity.cs:2212
    at (wrapper dynamic-method) object.4fd6b648-21b8-4bb7-a768-68c4fdb3402c (intptr,intptr,intptr) <IL 0x00017, 0x00027>

        at md5de12dab3ecb38eed1becafd37f3acdc1.FormActivity_1.n_onCreate(Native Method)
        at md5de12dab3ecb38eed1becafd37f3acdc1.FormActivity_1.onCreate(FormActivity_1.java:53)
        at android.app.Activity.performCreate(Activity.java:5231)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
        at android.app.ActivityThread.access$800(ActivityThread.java:135)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5017)
        ... 5 more

    Expected Result

    NO ERRORS

    All times are GMT -5. The time now is 10:21 PM.
    Previous Next