Widget Component- Changing Widget Class via Blueprints?

Is it possible to change the widget class via blueprints? I can’t seem to find a node that changes the “Widget Class” selection in the Widget Component.

Thanks

Eyo,

You can find it in BPWidget->Graph->ClassSettings->ClassOptions.

I haven’t tested this method in any of my projects, but yes it is possible. You can use the Widget Component’s “Set Widget” function for this purpose.

Oh, I might have misunderstood.

Isn’t “Set Widget” a function you should use when you want to override an already existing widget dynamically during runtime? :slight_smile:

Yes, I thought that was what @Allenheathx was referring to. The default class, on the other hand, can be set directly from the component details panel using the Widget Class parameter.

Well, he has two answers now anyway :smiley:

I appreciate it, Set Widget is what I need. I saw that but didn’t realize I have to Create the widget to pipe in (I was expecting I’d be able to select it from a list in the variable). Thanks

3 Likes

Im having issues with this. My list seems empty.
image
Is this the issue you had @Allenheathx ?

Anyone know why the list is empty?

1 Like

You should create your widget to set.

My Products

2 Likes

do you happen to have the answer for it now?

as I am facing the same issue.

It seems like none of the people above could just read the question properly. Since the question is what NODE can I use the change the widget class via blueprint, I would logically assume he wants to change it at runtime.

I have the same question for the option in the LIST VIEW > List Entries > ENTRY WIDGET CLASS. I would also like to know if it’s possible and how to change the class type AT RUNTIME.

This works! i was having the same issue and just created the widget. the drop down will say none. create the widget in BP and connect like this and it works no problem. i can now swap between necessary widgets dependent on bool vars in my BPs

You cannot change the Entry class at runtime, but there is a way around this limitation. I suggest using a dummy wrapper as an Entry, where you can create a widget of the class you need.

Follow these steps:

  1. Create the wrapper widget and add UserListObjectEntry interface:
    image
    Add an empty custom event ‘Update’.
    image

  2. Create an abstract user widget class with an ‘Object’ variable and add a custom event ‘Setup.’

  3. Create widgets inherited from the abstract widget and tweak them as you need. Then override ‘Setup’ event.


    image
    image
    image

  4. Create a blueprint interface with a function to get a custom entry class from the wrapper. Add the interface to your widget containing the list view. Override the function. Create events to choose and apply a new custom entry class.



  5. Return to the wrapper widget and create ‘AcquireEntryClass’ function

  6. Add events to create or update the needed custom entry widget.

  7. Result:
    CustomEntry

Thank you for your very detailed answer. All of this became so complicated that I ended up creating a separated list with it’s own widget item class, as it is easier to destroy the previous list and create the other one with it’s own item class or vis versa when needed. What a head banger just to do simple things in the widgets…