B4J Question CLVSelections - Crashing When CLV Changes

cklester

Well-Known Member
Licensed User
I've got a clv_Placeholder item into which I build various xCustomListViews, depending on the user's selection.

When I switch between them, I get a crash because (it seems) some index is not being reset. I'm not sure how to inform CLVSelections that the xCustomListView has changed. I've tried Refresh, Initialize, Clear, etc...

In the attached project, click the "Meeting Notes" button from the main page. Click "Set One." Select any item with index > 1. Click "Set Two." Click either item. Crash.

If you select items in "Set One" with index 0 or 1, selecting an item in "Set Two" does not crash.

I guess it's crashing because the index from the prior xCLV is still set at an index that is higher than any index in Set Two, and it must be trying to access it at that index for some reason.

How do I properly switch between xCLVs with CLVSelections and avoid this crash?
 

Attachments

  • clvs_crash.zip
    16.4 KB · Views: 205

cklester

Well-Known Member
Licensed User
Thanks, @Erel ! That was simple. :D

I didn't try the Clear in that order. :confused:

What's going on there? What does the CS2.Clear actually do?
 
Upvote 0
Top