Along the way, we took the liberty to rename a few concepts. For instance, in XForms, a control can be relevant or not. In Orbeon Forms, non-relevant controls aren't shown. So, in Form Builder, instead of talking of relevance, we use the term visibility. For every control, form authors can define whether the field is visible, and whether it is read-only. With this, controls can be in one of the 3 following states: read-write, read-only, invisible1.
We also brought what we consider to be a simplification to how controls type and required properties are handled. In XForms, you can specify the type of a field (typically for text fields), say xs:integer. Independently, you can define whether entering a value is required or not. Required fields are often styled with a red star showing next to the label, and to be valid a field must conform to both constraints: the value must be of the right type and it must not be empty if required. XForms authors often find the situation where they set the field to be non-required but use a type that doesn't accept empty values confusing, and this in two ways:
- Some are surprised to see that empty values are not accepted in a field of type xs:integer which they set to be non-required2.
- Some are surprised to see the field isn't styled with a red star, to indicate a value is required, since users can't leave the field empty3.
1 Some of those states might not make sense for some controls. For instance, a control that just shows text, like the text output control, is in effect always read-only.
2 Since an empty string isn't an xs:integer, XForms considers the field invalid, whether required is set to true or false. To get the expected behavior, those XForms authors will want to use the xforms:integer type instead, which accepts empty values.
3 For this, XForms authors will want to make sure to also set required to true.
4 Form Builder does this by picking for you the variant of the type that matches radio button you selected for required. For instance, for an integer, if required, the XForms type is set to xs:integer ; if not required, the type is set to xforms:integer.
Post a Comment