Wtx ~ Wt Extension Library
WtxLib
|
Public Member Functions | |
FormModel (Wtx::Dbo::TableDef &td) | |
Wtx::Dbo::TableDef & | tableDef () const |
virtual std::unique_ptr< Wt::WWidget > | createWidget (Wtx::Dbo::Session &session) |
virtual void | reset () |
virtual bool | validate () |
virtual bool | isVisible (Wt::WFormModel::Field field) const |
virtual bool | isReadOnly (Wt::WFormModel::Field field) const |
virtual Wt::WString | label (Wt::WFormModel::Field field) const |
Get Field Label. More... | |
virtual void | setValue (Wt::WFormModel::Field field, const Wt::cpp17::any &value) |
virtual const Wt::cpp17::any & | value (Wt::WFormModel::Field field) const |
virtual Wt::WString | valueText (Wt::WFormModel::Field field) const |
virtual void | setValidator (Wt::WFormModel::Field field, const std::shared_ptr< Wt::WValidator > &validator) |
virtual std::shared_ptr< Wt::WValidator > | validator (Wt::WFormModel::Field field) const |
virtual bool | validateField (Wt::WFormModel::Field field) |
virtual void | setValidated (Wt::WFormModel::Field field, bool validated) |
virtual bool | isValidated (Wt::WFormModel::Field field) const |
virtual void | setValidation (Wt::WFormModel::Field field, const Wt::WValidator::Result &result) |
Definition at line 64 of file FormModel.h.
|
virtual |
Get Field Label.
This will return the proper 'label' for a form field.
This will try first to get a label from the field-definition.
If there is no value in the field-def object, then this will turn to the base-class to see if there is a field-name in the transaltion table somewhere. According to the Wt docs, the system by default will perform a WString::tr(fieldName) and return that by default, so if there is no transaltion for this field name, then the return value is going to have '??fieldName??' (double-question-marks) surrounding the field name.
if the field-name could not be transalted properly, then this will just default to the actual field name itself, so that it doesn't look 'goofy' on the screens like '??keyField??' and so on...
Reimplemented in Wtx::Dbo::FormModel< C >.
Definition at line 137 of file FormModel.cpp.