Friends! Tell me why, when you try to update the text in the list, an error occurs . I created a project on github. https://github.com/Luummii/listunreal
I guess I don’t know anything. Really need help.
After starting the project, there will be a button on the screen. When you click on the button, a list with the text in each line should appear. The text is put in C++.
But instead, a list with the initial text set to BP appears and an error falls out.
I tried to understand and it turns out that the list item is not created at the time of installation of the text. But for what reason remains a mystery to me.
Look please, if not difficult, where there is a mistake.
Error occurs when calling the method
void UListComponent_CPP::SetActionName(FString TaskName)
and it happens because there is ensureMsgf(…).
But if you disable ensureMsgf, the Studio falls.
It crashes because the TextBlock_ActionName pointer is undefined. And very strange!!! For me:)
If the method implementation
void UListComponent_CPP::SetActionName(FString TaskName)
move to the constructor - set the text in the constructor, then there is no error and everything works well.
Excuse me, do you understand that the time when the list view item is generated as a widget and NativeConstruct is called is when it enters the display area?
Oh, my friend, forgive me. Maybe you can solve this problem then. Could you then make a push of code with a working example? The thing is that I tried to update the text in the list at different times of widget generation and yet the quest is not completed. :))
I checked a little, but ListView did something strange.
You can see that creating a constructor for UListComponent_CPP and setting a breakpoint
It seems that a completely new UListComponent_CPP is being generated instead of using the one set when entering the area.
OnEntryGenerated bound to the blueprint graph only passed the object generated above.
The rough calling order is as follows, so it may be better to look a little.
Very strange! A simple task - When you click on the button, update the list item. The update logic must be in C++. Asked this task here, in Discordchats in two channels, sent questions to youtubers who clever lessons do. No answer. Not who does not know how to work with it. Only simple General advice and remark - need to do so and so and so. And when you ask a question - You tried to realize your advice? - going oops…:)) Sorry, mate! Thank you for your help! You held out the longest:))