What widget content is selectable, for SListView::OnSelectionChanged?

In theory there should have been a compile error telling you that you cannot use TableViews with non-memory managed pointers. That is, the memory address of your type has to be guaranteed unique. UObject* are garbage collected, so you can use those. You can also use TSharedPtr< FString >/TSharedRef< FString > because they have the necessary property that their memory address is a unique ID. However, with a regular pointer, it is possible to have a pointer, delete it, and then have a new object allocated in the same location. Therefore, regular pointers are not unique and cannot be used by the TableViews.

So you’re going to have to do SListView< TSharedRef< FString > > or SListView< TSharedPtr< FString > >.
This seems like a pain, but it enabled selection tracking, expansion tracking, and virtualization.

Let me know if you have questions about all this.

EDIT: AnswerHUB is not cooperating with C++ templates. Needs extra space like so: < T >.

So, just for testing purposes I have the following widget:

   SAssignNew(SessionList, SListView<FString*>)
.OnSelectionChanged(this, &SDataVisUI::OnSessionSelectionChanged)
.OnGenerateRow(this, &SDataVisUI::OnGenerateRow)

The actual table row widgets are created using the following:

SNew(STableRow<FString*>, OwnerTable)

(I know that using FString* like this isnt so hot, but bear with me)

However, I can’t click on the strings that are displayed in the list in my UI and OnSessionSelectionChanged isn’t being called. Is there only a specific sub-set of widgets I can put inside table rows, that will allow me to use this mechanism, or some other flag I have to set on my table rows, or something else at play?

Great, thanks! Will try this out and mark if it sorts the issue.