Defines the minimal information for a dynamic control specification.
Usage:
A specification should be the minimal information required to create a
dynamic control. For example it may be enough to know just the ID if that
is one-to-one with the code to construct the control. If it is necessary
to know both the ID and some type information, the specification should
contain both.
A specification should not contain any non-unique information.
A specification must be serializable via JSON.stringify(), or convertible
to a serializable form during Control.getSerializableState()
Example:
Consider a ContactDetailsControl that adds controls of two different
types depending on what information the user needs to record. Lets assume
that the only dynamic data-fields are of type PhoneNumberControl &
AddressControl. To uniquely define each dynamic control we need to know
the id, the type, and the purpose/target. So an appropriate specification
would be:
Defines the minimal information for a dynamic control specification.
Usage:
JSON.stringify()
, or convertible to a serializable form duringControl.getSerializableState()
Example:
ContactDetailsControl
that adds controls of two different types depending on what information the user needs to record. Lets assume that the only dynamic data-fields are of typePhoneNumberControl
&AddressControl
. To uniquely define each dynamic control we need to know the id, the type, and the purpose/target. So an appropriate specification would be:DynamicContactControlSpecification:{ id: string type: {'phoneNumber', 'home'} | {'phoneNumber', 'work'} | {'address', 'home'} | ... }
Note: - the `id` is a mandatory part of the specification because it is needed to reattach the control's state object on subsequent turns.