I've got an MVC form working, using a WTemplateFormView backed by a WFormModel, with a bunch of WDoubleSpinBox fields and a submit button. (It's a calculator.)
I want to add a combo box to the form, but I'm not sure how to handle the field in the WFormModel.
I've looked at the example (http://www.webtoolkit.eu/widgets/forms/combo-box , under the "Model" heading), but it doesn't seem to be what I want; it doesn't ever mention "fields" (which are pervasive in WFormModel), and it has this statement: "Note that there are still other models like WFormModel which and [sic] can be used to represent fields in a form".
Can someone explain how to use a WComboBox backed by a WFormModel field? Or better yet, is there an example out there on the Web somewhere?
You can find a live example of WFormModel and WTemplateFormView at http://www.webtoolkit.eu/widgets/forms/integration-example
You can find it's source code at https://github.com/kdeforche/wt/blob/master/examples/widgetgallery/examples/FormModel.cpp
In the WFormModel you have to add the fields to the field list using WFormModel::addField() and in the WTemplateFormView you can set WComboBox or any other widget as a field widget using WTemplateFormView::setFormWidget()