Type (attribute of property)
The data type that defines a property.
Each type has it's own autogenerated way of displaying and validating. You can change the way a property is displayed by changing the widget attribute.
If you don't specify a type, the default is the String type.
A property may take one of the following data types:
- id: All entities have an implicit autoincremental and primary key int field called id to identify each row. If a transient field named id is added to the entity, it will take the same value as the primary key.
- enum: each enumeration is added with a subelement of this property. See enum
- date - Example value: 28/12/2010
- time - Example value: 15:30
- datetime - Example value: 28/12/2010 14:20
- timerange - Example value: 11:15 - 11:45
- timequantity - Example value: 3d 1h 15m
<entity ...> <property name = NAME label = LABEL entity = ENTITY | type = TYPE ... /> ... <entity/>
- A property of type entity:
<property display="primary" entity="Seller" label="Responsable" name="seller">
The default widget for entity-type properties is an HTML select element.
- A property of type image:
<property label="Image" name="logo" type="image"/>
Image-type properties are displayed as a small box with the image and a filechooser button.
- When using price properties it is important to set them as double types so that they are not considered strings an calculations can be done with them.
<property name="price" label="Price" type="double" />