The combobox

Combobox, picklist or dropdown list – 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 looses it's set value after a short while, or is not set correctly when you open the page, it's usually due to that you don't have the already selected value in the collection. Always remember to add the current value of the attribute to the selection collection.

And, if you think that you have the current value 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. 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 you need to pick many - or have complex values in the picker list - consider to create one of multiple widgets in placingcontainers.

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