ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

RadListView grouping crash when groupingFunction is not bound to viewmodel #1513

Open felixkrautschuk opened 3 years ago

felixkrautschuk commented 3 years ago

Please take a minute to read our NativeScript Code of Conduct before proceeding with posting issues or discussing. The purpose of this guide is to make communication and cooperation within our forums a pleasure for you and the other members.

Please, provide the details below:

Tell us about the problem

When setting the groupingFunction in XML like this:

<!-- main-page.xml -->
<lv:RadListView items="{{ items }}" groupingFunction="myGroupingFunc" ...

and defining the groupingFunction lin the code-behind like this:

//main-page.ts
export function myGroupingFunc(item: DataItem): string {
    return item.category;
}

The app crashes with the following log:

System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method onCreateView failed System.err: TypeError: owner.groupingFunction is not a function System.err: System.err: StackTrace: System.err: ListViewGroupDescriptorImpl.groupForItem(file: node_modules/nativescript-ui-listview/ui-listview.android.js:1090:0) System.err: at loadData(file: node_modules/nativescript-ui-listview/ui-listview.android.js:2063:0) System.err: at createNativeView(file: node_modules/nativescript-ui-listview/ui-listview.android.js:1178:0) System.err: at _setupUI(file: node_modules/@nativescript/core/ui/core/view-base/index.js:525:0) System.err: at (file: node_modules/@nativescript/core/ui/core/view-base/index.js:567:0) System.err: at eachChildView(file: node_modules/@nativescript/core/ui/layouts/layout-base-common.js:101:0) System.err: at eachChild(file: node_modules/@nativescript/core/ui/core/view/view-common.js:700:0) System.err: at _setupUI(file: node_modules/@nativescript/core/ui/core/view-base/index.js:566:0) System.err: at (file: node_modules/@nativescript/core/ui/core/view-base/index.js:567:0) System.err: at eachChildView(file: node_modules/@nativescript/core/ui/content-view/index.js:65:0) System.err: at eachChildView(file: node_modules/@nativescript/core/ui/page/page-common.js:98:0) System.err: at eachChild(file: node_modules/@nativescript/core/ui/core/view/view-common.js:700:0) System.err: at _setupUI(file: node_modules/@nativescript/core/ui/core/view-base/index.js:566:0) System.err: at _addViewCore(file: node_modules/@nativescript/core/ui/core/view-base/index.js:429:0) System.err: at _addView(file: node_modules/@nativescript/core/ui/core/view-base/index.js:418:0) System.err: at onCreateView(file: node_modules/@nativescript/core/ui/frame/index.android.js:740:0) System.err: at onCreateView(file: node_modules/@nativescript/core/ui/frame/fragment.android.js:25:0) System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1175) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1153) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1149) System.err: at com.tns.FragmentClass.onCreateView(FragmentClass.java:55) System.err: at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2699) System.err: at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320) System.err: at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199) System.err: at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368) System.err: at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446) System.err: at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509) System.err: at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447) System.err: at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2181) System.err: at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2004) System.err: at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1959) System.err: at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1861) System.err: at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413) System.err: at android.os.Handler.handleCallback(Handler.java:883) System.err: at android.os.Handler.dispatchMessage(Handler.java:100) System.err: at android.os.Looper.loop(Looper.java:214) System.err: at android.app.ActivityThread.main(ActivityThread.java:7356) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

====== Assertion failed ====== Native stack trace: 1 0x10ebf0630 tns::Assert(bool, v8::Isolate) + 119 2 0x10ec13416 tns::Interop::WriteValue(v8::Local, tns::TypeEncoding const, void, v8::Local) + 5218 3 0x10ec11f9c tns::Interop::SetFFIParams(v8::Local, tns::TypeEncoding const, tns::FFICall, int, int, tns::V8Args&) + 110 4 0x10ec11c0b tns::Interop::CallFunctionInternal(tns::MethodCall&) + 415 5 0x10eb5eac9 tns::ArgConverter::Invoke(v8::Local, objc_class, v8::Local, tns::V8Args&, tns::MethodMeta const, bool) + 735 6 0x10ebb79b8 tns::MetadataBuilder::InvokeMethod(v8::Local, tns::MethodMeta const, v8::Local, tns::V8Args&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, bool) + 76 7 0x10ebb725f tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo const&) + 219 8 0x10ed27d2c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620 9 0x10ed271dc v8::internal::MaybeHandle v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::BuiltinArguments) + 556 10 0x10ed26863 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate) + 259 11 0x10f5bf819 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57 JavaScript stack trace: at push.../node_modules/nativescript-ui-listview/ui-listview.js.TKListViewDataSourceImpl.initDataOperationsSource (file: node_modules/nativescript-ui-listview/ui-listview.ios.js:543:0) at push.../node_modules/nativescript-ui-listview/ui-listview.js.TKListViewDataSourceImpl.initWithOwner (file: node_modules/nativescript-ui-listview/ui-listview.ios.js:528:0) at reloadDataSource (file: node_modules/nativescript-ui-listview/ui-listview.ios.js:873:0) at initNativeView (file: node_modules/nativescript-ui-listview/ui-listview.ios.js:882:0) at setNativeView (file: node_modules/@nativescript/core/ui/core/view-base/index.js:582:0) at _setupUI (file: node_modules/@nativescript/core/ui/core/view-base/index.js:560:0) at (file: node_modules/@nativescript/core/ui/core/view-base/index.js:567:0) at eachChildView (file: node_modules/@nativescript/core/ui/layouts/layout-base-common.js:101:0) at eachChild (file: node_modules/@nativescript/core/ui/core/view/view-common.js:700:0) at _setupUI (file: node_modules/@nativescript/core/ui/core/view-base/index.js:566:0)

Which platform(s) does your issue occur on?

Android and iOS

Please provide the following version numbers that your issue occurs with:

Please tell us how to recreate the issue in as much detail as possible.

Start the application

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

ns-rlv-grouping.zip