Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ui::FormFieldMapping< Row, Value > Class Template Reference

Owning declaration of one current-record field; no widget or edit runtime is created here. More...

#include <ui_model_form.hpp>

Public Member Functions

 ~FormFieldMapping ()=default
 Keep owning configuration transfers fallible before mount.
 FormFieldMapping (std::string_view caption, Value Row::*member)
FormFieldMapping & required (bool enabled=true)
FormFieldMapping & readOnly (bool enabled=true)
FormFieldMapping & validate (std::function< bool(const Value &)> rule)
FormFieldMapping & options (FormFieldConfig config)
FormFieldMapping & reference (Ref< FormField > reference)
FormFieldMapping & key (std::string_view key)
FormFieldMapping & codec (EditTextCodec< Value > codec)
template<class Factory>
FormFieldMapping & editor (Factory factory)

Detailed Description

template<class Row, class Value>
class portals::ui::FormFieldMapping< Row, Value >

Owning declaration of one current-record field; no widget or edit runtime is created here.

Template Parameters
RowOwning copyable record shared by navigation and its edit session.
ValueOwning copyable member value; default text editors support string and arithmetic except bool. Other values use an explicit codec/editor and a compatible endpoint ownership/accounting contract. Member pointers are local selectors, not persistent schema identities. Copying this declaration retains its callbacks, caption and codec.

Constructor & Destructor Documentation

◆ FormFieldMapping()

template<class Row, class Value>
portals::ui::FormFieldMapping< Row, Value >::FormFieldMapping ( std::string_view caption,
Value Row::* member )
inline
Parameters
captionLiteral UTF-8 label copied now.
memberLocal record selector. Owns its declaration and retains no record/page reference.

Member Function Documentation

◆ codec()

template<class Row, class Value>
FormFieldMapping & portals::ui::FormFieldMapping< Row, Value >::codec ( EditTextCodec< Value > codec)
inline
Parameters
codecOwning complete scalar conversion, retained together with target-local text history.
Returns
This declaration with an explicit codec; copies share the same codec owner. A field cannot be remapped to a different codec while its edit session retains the original representation.

◆ editor()

template<class Row, class Value>
template<class Factory>
FormFieldMapping & portals::ui::FormFieldMapping< Row, Value >::editor ( Factory factory)
inline
Template Parameters
FactoryCopyable owning function returning an ordinary widget recipe.
Parameters
factoryReceives the typed field and requested user read-only policy. It must bind its real property through the typed field/endpoint and honor this policy in its editor. The wrapper supplies captions/help and required marker; custom value validation, history, focus and source-readonly presentation belong to the factory.
Returns
This declaration using a real custom editor; no arbitrary widget-property connection is inferred.

◆ key()

template<class Row, class Value>
FormFieldMapping & portals::ui::FormFieldMapping< Row, Value >::key ( std::string_view key)
inline
Parameters
keyNonempty owning schema identity for requests; omitted uses the session's local member key.
Returns
This declaration using the explicit key at mapping time.

◆ options()

template<class Row, class Value>
FormFieldMapping & portals::ui::FormFieldMapping< Row, Value >::options ( FormFieldConfig config)
inline
Parameters
configExisting FormField text validation, async validation, messages and editor settings.
Returns
This declaration replacing its ordinary native configuration.

◆ readOnly()

template<class Row, class Value>
FormFieldMapping & portals::ui::FormFieldMapping< Row, Value >::readOnly ( bool enabled = true)
inline
Parameters
enabledBlock user editing with the existing native policy; explicit typed commands remain checked.
Returns
This declaration retaining navigation and readable current-record values.

◆ reference()

template<class Row, class Value>
FormFieldMapping & portals::ui::FormFieldMapping< Row, Value >::reference ( Ref< FormField > reference)
inline
Parameters
referenceOrdinary FormField observation published after the complete form mounts.
Returns
This declaration using the existing Ref family; use reference.editor() for its LineEdit.

◆ required()

template<class Row, class Value>
FormFieldMapping & portals::ui::FormFieldMapping< Row, Value >::required ( bool enabled = true)
inline
Parameters
enabledReject empty scalar text at publication and show the native required marker.
Returns
This declaration with the standard FormField required policy.

◆ validate()

template<class Row, class Value>
FormFieldMapping & portals::ui::FormFieldMapping< Row, Value >::validate ( std::function< bool(const Value &)> rule)
inline
Parameters
ruleOwning typed synchronous rule; borrowed candidates expire when it returns.
Returns
This declaration with an additional typed publication rule.

The documentation for this class was generated from the following file: