There should be a method to accept validator and Wt::WItemDelegate::doCloseEditor() should check the validator before saving the data.
Updated by Wim Dumon over 9 years ago
It sounds sensible to have something that combines validators and the MVC system of Wt.
We were thinking of maybe adding a ValidationRole to the model, and checking that validator in WItemDelegate. Any other ideas? Do you know if other toolkits (Qt?) have such support built-in?
Updated by Saif Rehman over 9 years ago
I don't have any experience with any other toolkit. However I do believe your validationRole approach may be the best solution since the programmer has the most choice even on providing different validation for each row and column.
I have another suggestion. Maybe Wt could check the data type which has been set for a display/edit role field and automatically adding a validator for the type. Like int data would have WIntValidation and so on.