# \[Slate\] SComboBox doesn´t update laben OnSelectionChanged()

**URL:** <https://forums.unrealengine.com/t/slate-scombobox-doesn-t-update-laben-onselectionchanged/93541>\
**Category:** C++\
**Tags:** unreal-engine, Engine-Source-Code, GitHub, Engine-Source-GitHub\
**Created:** [June 2, 2017, 6:31am UTC](https://forums.unrealengine.com/t/slate-scombobox-doesn-t-update-laben-onselectionchanged/93541 "2017-06-02T06:31:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxAuer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MaxAuer](https://forums.unrealengine.com/u/MaxAuer)\
**Post date:** [June 2, 2017, 6:31am UTC](https://forums.unrealengine.com/t/slate-scombobox-doesn-t-update-laben-onselectionchanged/93541/1 "2017-06-02T06:31:13Z")

</div>

Hey guys,

I´m having a hard time understanding Slate and its update behaviour in an editor plugin.

I have a SComboBox which shows a few categories. If I choose another option my OnSelectionChanged  
event gets fired but the label on the checkbox doesn´t update.

Am I missing something how Slate draws itself? Do I need to “redraw” the UI?

If anybody can guide me to a proper guide on how to setup a Editor Window which has a lot of dynamic changes I will be forever grateful.  
Having a hard time to find good documentation for Slate in the editor.

Example code:

```auto

void SCategoryComboBox::Construct(const FArguments& Args, std::vector<Category> categories)
{
	setItems(categories);

	ChildSlot
		
			SNew(SComboBox<TSharedPtr<Category>>)
			.OptionsSource(&Categories)
			.OnSelectionChanged(this, &SCategoryComboBox::OnSelectionChanged)
			.OnGenerateWidget(this, &SCategoryComboBox::MakeWidgetForOption)
			.InitiallySelectedItem(SelectedCategory)
			
				SNew(STextBlock)
				.Text(FText::FromString(SelectedCategory->Name))
			]
		];
}

void SCategoryComboBox::OnSelectionChanged(TSharedPtr<Category> newSelection, ESelectInfo::Type)
{
	SelectedCategory = newSelection;
}

TSharedRef<SWidget> SCategoryComboBox::MakeWidgetForOption(TSharedPtr<Category> inOption)
{
	return SNew(STextBlock).Text(FText::FromString(inOption->Name));
}

```

Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![MaxAuer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MaxAuer](https://forums.unrealengine.com/u/MaxAuer)\
**Post date:** [June 20, 2017, 1:31pm UTC](https://forums.unrealengine.com/t/slate-scombobox-doesn-t-update-laben-onselectionchanged/93541/2 "2017-06-20T13:31:04Z")

</div>

Still couldn´t figure it out. Bump!

---

<div class="post-metadata">

**Author:** ![Repin\_Design](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/repin_design/32/598391_2.png) [@Repin\_Design](https://forums.unrealengine.com/u/Repin_Design)\
**Post date:** [January 20, 2025, 7:08pm UTC](https://forums.unrealengine.com/t/slate-scombobox-doesn-t-update-laben-onselectionchanged/93541/3 "2025-01-20T19:08:10Z")

</div>

having same code and same propblem in 2025

---

<div class="post-metadata">

**Author:** ![STRiFE.x](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/strife.x/32/969826_2.png) [@STRiFE.x](https://forums.unrealengine.com/u/STRiFE.x)\
**Post date:** [January 21, 2025, 12:00pm UTC](https://forums.unrealengine.com/t/slate-scombobox-doesn-t-update-laben-onselectionchanged/93541/4 "2025-01-21T12:00:22Z")

</div>

SComboBox doesn’t update the text automatically. You need to update the text yourself when selection changes. Use `SAssignNew` to store a reference to the text when constructing the widget. Then set its text when selection changes.

---

<div class="post-metadata">

**Author:** ![Repin\_Design](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/repin_design/32/598391_2.png) [@Repin\_Design](https://forums.unrealengine.com/u/Repin_Design)\
**Post date:** [January 21, 2025, 8:00pm UTC](https://forums.unrealengine.com/t/slate-scombobox-doesn-t-update-laben-onselectionchanged/93541/5 "2025-01-21T20:00:00Z")

</div>

Tank you mate, i used textlambda to update it
