Project

General

Profile

Feature #2051

Wt::WItemDelegate validation

Added by Saif Rehman over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/20/2013
Due date:
% Done:

0%

Estimated time:

Description

There should be a method to accept validator and Wt::WItemDelegate::doCloseEditor() should check the validator before saving the data.

#1

Updated by Wim Dumon over 8 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?

Wim.

#2

Updated by Saif Rehman over 8 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.

Also available in: Atom PDF