A combo box is a drop-down list allowing you to choose one option from a list of options.
A WComboBox corresponds to an HTML
WComboBox is a View widget (see also
which instantiates its own
WStringListModel by default. You can use this widget also in
conjunction with another model.
You can capture the selected item and deal with it using a signal/slot mechanism.
WComboBox is an MVC class (model-view-controller). By default a
WStringListModel is used. With this model you can associate a
single column of data to the displayed items. The member methods
manipulate the model. You can set the model with
Item models support different roles like
Wt::ItemDataRole::UserRole. The text for an item in the
drop-down box is associated with a
Wt::ItemDataRole::DisplayRole. Typically, you will associate the
underlying "value" with a
Wt::ItemDataRole::UserRole). In this
way, you can also add additional user roles.
Note that there are still other models like WFormModel which and can be used to represent fields in a form.