Metadata Option element
The option element is only used in combination with Metadata Select field. The option value represents a distinct value to select.
| Attribute | Description | Required |
|---|---|---|
| label | The text shown as the label in the user interface. | true |
| value | Unique value identifier. Two options cannot have the same value. Value must be unique. It’s recommended to use only characters that match this regular expression: [a-z_] (a to z in lowercase and underscore, no spaces) |
true |
| parentValue | When present, it specifies the option’s parent. The parent must be present in another select. |
false |
| selected | When set to true, this option is pre-selected when the form is rendered. Accepted values: true, false. Default: false. |
false |
| cssClass | CSS class. More information about creating your own styles is available at CSS. |
false |
- Parent:
Basic select with selected option
Section titled “Basic select with selected option”- The attribute
selected="true"specifies that an option should be pre-selected when the form is rendered.
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 3.15//EN" "http://www.openkm.com/dtd/property-groups-3.15.dtd"><property-groups> <property-group label="Consulting" name="okg:consulting"> <select label="select label" name="okp:consulting.select" type="simple"> <option label="one" value="001" /> <option label="two" value="002" selected="true"/> <option label="three" value="003" /> </select> </property-group></property-groups>Hierarchical relationship
Section titled “Hierarchical relationship”- The field option value of “okp:consulting.children” has a parent relation with “okp:consulting.parent”. It is defined by parentElement=“okp:consulting.parent”.
- The option value “benefits” of the field “okp:consulting.children” has a parent value “directives” in the field “okp:consulting.parent”.
Tree relationships:
- directives
- benefits
- eligibility
- services
- handbook
- basic
- normal
- advanced
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 3.15//EN" "http://www.openkm.com/dtd/property-groups-3.15.dtd"><property-groups> <property-group label="Consulting" name="okg:consulting"> <select label="Provincia" name="okp:consulting.parent" type="simple"> <option value="directives" label="Directives" /> <option value="handbook" label="Handbook Paragraphs" /> </select> <select label="Provincia" name="okp:consulting.children" type="simple" parentElement="okp:consulting.parent"> <option value="benefits" label="Benefits" parentValue="directives" /> <option value="eligibility" label="Eligibility" parentValue="directives" /> <option value="services" label="Services" parentValue="directives" /> <option value="basic" label="Basic" parentValue="handbook" /> <option value="normal" label="Advanced" parentValue="handbook" /> <option value="advanced" label="Normal" parentValue="handbook" /> </select> </property-group></property-groups>