Outline

Proposed text

6 Model Item Properties

This chapter defines infoset contributions that can be bound to instance data nodes with the bind element (see 3.3.4 The bind Element) and form control (see Form control) elements.

Examples

Assigning a data type to a form control

<xf:input ref="cc" type="xf:card-number">
  <label>...</label>
</xf:input>

generates

<model>
  ...
  <xf:bind nodeset="cc" type="xf:card-number" />
</model>
...
<xf:input ref="cc">
  <label>...</label>
</xf:input>

Assigning MIPs to controls in a container control

<xf:group ref="payment-info">
  ...
  <xf:input ref="cc" type="xf:card-number">
    <label>...</label>
  </xf:input>
</xf:group>

generates

<model>
  ...
  <xf:bind nodeset="payment-info[1]">
    ...
    <xf:bind nodeset="cc" type="xf:card-number" />
  </xf:bind>
</model>
...
<xf:group ref="payment-info">
  ...
  <xf:input ref="cc">
    <label>...</label>
  </xf:input>
</xf:group>

Assigning MIPs to controls in a repeat

<xf:repeat nodeset="payment-info">
  ...
  <xf:input ref="cc" type="xf:card-number">
    <label>...</label>
  </xf:input>
</xf:repeat>

generates

<model>
  ...
  <xf:bind nodeset="payment-info">
    ...
    <xf:bind nodeset="cc" type="xf:card-number" />
  </xf:bind>
</model>
...
<xf:repeat nodeset="payment-info">
  ...
  <xf:input ref="cc">
    <label>...</label>
  </xf:input>
</xf:repeat>

Pending Questions

Why do we need MIPs on form controls?

There are two reasons why we want to allow model item properties on form controls :

  1. For the easy of authoring when creating simple forms and you are using an implicit instance. When you created your form using lazy creation but now want to add some model item properties (for example types, constraints, ...) it would be nice that you just could add those model item properties to the form controls without the need to create a model element nor a bind element.
  2. When you have a separate model and form UI designer there are cases where the UI designer can add extra model item properties to certain controls that don't need to be enforced by the model (for example extra constraint, stricter type, UI control is read only)


CategoryXFormsFutureFeatures

Add model item properties to UI level (last edited 2008-02-27 13:45:24 by NickVanDenBleeken)