Project

General

Profile

Feature #4700

Some suggestions for WTemplateFormView and WFormModel

Added by Saif Rehman over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
01/26/2016
Due date:
% Done:

0%

Estimated time:

Description

1. Link WValidator::validate() and WFormModel::validateField(): Calling these 2 functions currently have different behavior, if WFormModel::validateField() is not called, the field-info value (for error messages) is not updated. To implement it, a signal, which will be emitted when the WValidator is validated, could be introduced in the WValidator and the WFormModel can listen to that signal to keep consistent behavior.

2. If no WFormModel::setValidator() is set, use the WFormWidget::validator() by default. Currently, WFormModel assumes there is no validator, even if the WFormWidget does have a validator.

3. Make WTemplateFormView a WFormWidget OR make a derived class which inherits from both, WFormWidget and WTemplateFormView so that implementing sub-views inside a WTemplateFormView would not require specializing validation, updateModel and updateView functions, or something similar.

4. When setting a modelValue which is not Wt::asString() convertible, an error such as [error] "WAbstractItemModel: unsupported type 'class Wt::Dbo::ptr'" is reported, when WFormModel::validate() is called. I'm not sure if I'm not supposed to do this, but everything works fine if I don't rely on the WString &input parameter of WValidator::validate(const WString &input) (since it will be an empty string)

No data to display

Also available in: Atom PDF