List View - how to set focus on item

I have some problem with List View widget. UE version 2.27
I’m using it to implement dialog system. Each element in LV is one simple widget that contains Button ant Text. I want to set focus not at LV itself but at specific widgit inside LV. So it would be possible to navigate through with gamepad or keyboard, not mouse only.
As soon as LV contains and use Object to generate widgets, I can’t simply cast to one of it’s elements and use “set user focus” - Object simply does not have this method.
I tried to implement “On Create” method inside ListViewEntryWidget class that would set focus on itself (or on the Button inside this EntryWidget), but it works with bug - it allows me to navigate through LV items, BUT only after second input. Example:
I mark first (index 0) Object as one that has to be focused. I open the Widget. I tap D-Pad button “down”. Nothing happens. I Press it again - second item gets a focus with doted line around it. Now I can fully navigate through all List View elements. I have to get rid of this double tap problem.

Thanks for your time and help me please…

1 Like

I found a way! You can add a ref to your widget inside of you list data entry uobject. Then you can simply call set focus on it! Its annoying there is no method in BP to get the widget for a list item, but this worked for me.

1 Like

I’m having the EXACT same problem as the topic creator but I’m not sure I understand your solution here? Can you post some screenshots so I’m clear? I feel like I’m on the verge of having a solution that works here…

Hey sorry low on time but as to how I set focus. First in “Item Entry Data” I save the widget -data connection. In your Entry data add variable of type widget. Then in your “Event On List Item Object Set” in your custom “tree view entry bp”. U then set the variable in your entry equals self to save it. Then u can get widget from data etc. I use then “Set focus” node and then “navigate to item” node as last steps.

WBP-Treeview Entry override to save widget

Variable inside entry data.