I have a B4xCombobox on a panel in a custom list view which has multiple instances of the panel.
When the user changes a combobox the _SelectedIndexChanged event is called.
Normally I would use:
But this causes a crash. Is there any way to find out which item in a CLV is pressed ?
Thanks
When the user changes a combobox the _SelectedIndexChanged event is called.
Normally I would use:
B4X:
Private vw As B4XView = Sender
Private indx As Int = clv.GetItemFromView(vw) ' Crash on this line
Log("Clv Index = "& indx)
End Sub
But this causes a crash. Is there any way to find out which item in a CLV is pressed ?
Thanks
Error occurred on line: 875 (LandingPage)
java.lang.ClassCastException: uk.co.digitwell.tickedit.b4xcombobox cannot be cast to android.view.View
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java:69)
at anywheresoftware.b4a.objects.B4XViewWrapper.getParent(B4XViewWrapper.java:166)
at b4a.example3.customlistview._getitemfromview(customlistview.java:408)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1068)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1023)
at uk.co.digitwell.tickedit.b4xcombobox._raiseevent(b4xcombobox.java:159)
at uk.co.digitwell.tickedit.b4xcombobox._cmbbox_itemclick(b4xcombobox.java:145)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$1.run(BA.java:335)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:180)
at android.app.ActivityThread.main(ActivityThread.java:6944)
java.lang.ClassCastException: uk.co.digitwell.tickedit.b4xcombobox cannot be cast to android.view.View
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java:69)
at anywheresoftware.b4a.objects.B4XViewWrapper.getParent(B4XViewWrapper.java:166)
at b4a.example3.customlistview._getitemfromview(customlistview.java:408)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1068)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1023)
at uk.co.digitwell.tickedit.b4xcombobox._raiseevent(b4xcombobox.java:159)
at uk.co.digitwell.tickedit.b4xcombobox._cmbbox_itemclick(b4xcombobox.java:145)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$1.run(BA.java:335)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:180)
at android.app.ActivityThread.main(ActivityThread.java:6944)