Standard editor attributes
Listed below are the standard configuration attributes, common to all types of editor. Some mandatory, and some optional. Each editor has its own additional configuration attributes: consult the editor-specific sections for a list of additional attributes.
| Attribute | Use |
|---|---|
ex:editorFor (required) |
Property name to edit. |
ex:editorType (required) |
Editor type. |
ex:editorLabel (required) |
Label to display on left hand side of form. |
ex:editorUsage (optional) |
When should this editor appear? A value of create means the field will only appear when editing a new item, update means the field only appears when updating an existing item. |
ex:validator (optional) |
Name of a JavaScript function to call to validate this field’s data. |
ex:initialValue (optional) |
Initial value to assign to this editor when creating a new item. |
ex:help (optional) |
Context help message for this field. |
Textfield
The textfield editor (ex:editorType="textfield") is used to capture short single lines of text. It is ideal for names, titles, etc.
<div ex:editorFor="label" ex:editorType="textfield" ex:editorLabel="Label" ex:editorUsage="create" ex:validator="validateLabel" ex:columns="20"></div>
| Attribute | Use |
|---|---|
ex:columns (optional) |
Width, in characters, of the UI component. |
Textarea
The textarea editor (ex:editorType="textarea") is used to capture long sections of text. It is ideal for descriptions.
<div ex:editorFor="description" ex:editorType="textarea" ex:editorLabel="Description" ex:validator="validateNotEmpty" ex:columns="40" ex:rows="5"></div>
| Attribute | Use |
|---|---|
ex:columns (optional) |
Width, in characters, of the UI component. |
ex:rows (optional) |
Height, in characters, of the UI component. (Note: some browsers will add space for a horizontal scrollbar, even if one is not required.) |
Enumsingle
The enumsingle editor selects one option from a prescribed list.
<div ex:editorFor="session" ex:editorType="enumSingle" ex:editorLabel="Session" ex:validator="testValidator" ex:enumValues="Lecture 1;Lecture 2;Lecture 3;Lecture 4;Lecture 5;Lecture 6;Lecture 7"></div>
| Attribute | Use |
|---|---|
ex:enumValues (required) |
A semi-colon separated list of options, or *. |
Note: an asterisks may be used in place of the ex:enumValues list to generate a list of unique values from existing records. This is a convenient way to populate the enum selector if your current items already have examples of all the potential property values.
Enummulti
The enummulti editor selects zero or more options from a prescribed list.
<div ex:editorFor="dc_subject" ex:editorType="enumMulti" ex:editorLabel="Subjects" ex:validator="testValidator" ex:height="5em" ex:enumValues="*"></div>
| Attribute | Use |
|---|---|
ex:enumValues (required) |
A semi-colon separated list of options, or *. |
ex:width (optional) |
CSS width of the component (eg: 10em). |
ex:height (optional) |
CSS height of the component (eg: 5em). |
Note: an asterisks may be used in place of the ex:enumValues list to generate a list of unique values from existing records. This is a convenient way to populate the enum selector if your current items already have examples of all the potential property values.
Number
The number editor permits the entry of positive or negative integer values.
<div ex:editorFor="birth_date" ex:editorType="number" ex:editorLabel="Year of birth" ex:columns="5" ex:rangeHigh="death_date"></div> <div ex:editorFor="death_date" ex:editorType="number" ex:editorLabel="Year of death" ex:initialValue="2000" ex:columns="5" ex:rangeLow="birth_date" ex:rangeHigh="2011"></div>
| Attribute | Use |
|---|---|
ex:columns (optional) |
Width, in characters, of the UI component. |
ex:rangeLow (optional) |
The lowest permitted value. This may be an absolute integer value, or the name of another property. If a property name is used, the current value of that property is taken as being the lowest permitted value. |
ex:rangeHigh (optional) |
The highest permitted value. This may be an absolute integer value, or the name of another property. If a property name is used, the current value of that property is taken as being the highest permitted value. |
Note: the fact ex:rangeLow and ex:rangeHigh can refer to other editable properties means it is possible to do tricks like ensure a person’s birth year is never after their death, and their death is never before their birth.
Itemref
The itemref editor is used to connect items together from different collections (item types). It is effectively a enummulti, but populated from the records of a collection.
<div ex:editorFor="foaf_depicts" ex:editorType="itemRef" ex:editorLabel="Philosophers" ex:validator="testValidator" ex:ref="person" ex:height="5em"></div>
| Attribute | Use |
|---|---|
ex:ref (required) |
Name of the item type to link to. |
ex:width (optional) |
CSS width of the component (eg: 10em). |
ex:height (optional) |
CSS height of the component (eg: 5em). |
