The combobox

Combobox, picklist, or dropdown list – there are many names for the same thing.

How to define one in a view: Comboboxes in MVC from model-driven ViewModel

Problem-solving

If you have a combobox that loses its set value after a short while or that is set incorrectly when you open the page, this is usually because you don't have the already selected value in the collection. Remember to always add the current value of the attribute to the selected collection.

And, if you think you have the current value or that it is already in the collection, check that the collection you are using is not "stable" over time. That is, the collection might look the same, but it's actually reconstructed and therefore new objects. Comboboxes work with objects, not values. If the list is known and stable over time, have one created for the ecospace and reuse it as long as possible. It might even be best to store it in the DB.

Also see: Comboboxes with strings

Multi-select Items in Combobox

If you have the need for a Combobox-like functionality but have to pick many - or have complex values in the picker list - consider creating one of the multiple widgets in PlacingContainers.

2022-11-20 19h11 45.gif
2022-11-20 19h14 09.png
This page was edited 149 days ago on 06/17/2024. What links here