#include <icy/symple/form.h>Inherits:
FormElement
Interactive form with pages, sections, and fields for command data exchange.
Attach a Form to a Command message to carry structured input/output. The action field governs the exchange direction; partial enables live/auto-complete field submission.
| Return | Name | Description |
|---|---|---|
Form | Constructs an unbound form (root pointer is null). | |
Form | Constructs a form bound to the given JSON node. Sets the type field to "form". | |
Form | Constructs a form from a Command, binding to command["form"]. Sets the type field to "form". | |
bool | valid | Returns true if the element is valid, non-empty, and has no errors. |
std::string | action const | Returns the form action string (defaults to "form"). |
bool | partial const | Returns true if this is a partial form submission. |
void | setAction | Sets the form action field. Throws std::invalid_argument for unrecognised values. Possible values: form - Form-processing entity requests form completion. submit - Form-submitting entity is sending data. cancel - Form-submitting entity cancelled submission. result - Form-processing entity is returning data. |
void | setPartial | Marks the form as a partial section for live/auto-complete updates. Partial forms transmit only the changed fields rather than the entire form payload. |
Form()Constructs an unbound form (root pointer is null).
Form(json::Value & root)Constructs a form bound to the given JSON node. Sets the type field to "form".
root JSON node to bind to.Form(Command & root)Constructs a form from a Command, binding to command["form"]. Sets the type field to "form".
root Parent command message.bool valid()Returns true if the element is valid, non-empty, and has no errors.
const
std::string action() constReturns the form action string (defaults to "form").
const
bool partial() constReturns true if this is a partial form submission.
void setAction(std::string_view action)Sets the form action field. Throws std::invalid_argument for unrecognised values. Possible values: form - Form-processing entity requests form completion. submit - Form-submitting entity is sending data. cancel - Form-submitting entity cancelled submission. result - Form-processing entity is returning data.
action Action string.void setPartial(bool flag)Marks the form as a partial section for live/auto-complete updates. Partial forms transmit only the changed fields rather than the entire form payload.
flag True to mark as partial.