Lookup
Live demos in the Inputs/Lookup and Inputs/Lookup (Combobox) menu entries.
Renders a lookup field.
Node name : lookup
Attributes
Bound
| Attribute | Type | Required | Default value | Description |
|---|---|---|---|---|
| property-name | string |
true |
UI view property name | |
| item | UI view | false |
@DatasourceCurrent |
Item to be bound to |
Unbound
| Attribute | Type | Required | Default value | Description |
|---|---|---|---|---|
| name | string |
true |
Lookup name | |
| value | string |
true |
Input value. | |
| is-reference | bool |
Depends on value type | Force the lookup to update the model with the complete reference object instead of the value property | |
reference-entity-view-name (Only available if is-reference attribute is set to true) |
string |
false |
Use the entity view on which the lookup search UI view is based | Force the lookup to return a reference from the specified entity view |
| label | string |
false |
Input label. | |
| disabled | bool |
false |
false |
Value indicating whether the input is disabled |
| readonly | bool |
false |
false |
Value indicating whether the input is read-only. |
| required | bool |
false |
false |
Value indicating whether the input is required. |
| message-text | string |
false |
Additional message displayed next to the component. Usually a warning or an error message. | |
| message-severity | string (information, warning, error) |
false |
Severity of the additional message displayed next to the component. | |
| documentation | string |
false |
Documentation | |
| tab-stop | bool |
false |
true |
Value indicating whether the input can be focused using the Tab key. |
| value-changed | string |
false |
Name of the method called when the value has changed. The first parameter is the value and the second is the current item of the data source (DatasourceCurrent) or the iterated item in a repeat component. |
Common
| Attribute | Type | Required | Default value | Description |
|---|---|---|---|---|
| label-position | string (top, left, right, hidden) |
false |
top |
Input label position. |
| message-position | string (bottom, hidden) |
false |
bottom |
Input message position. |
| focused | bool |
false |
false |
Value indicating whether the component is focused. |
Examples
Bound
<lookup property-name="PropertyName" />
Unbound
If the type of the bound value can be implicitly determined as a reference or a scalar property, the is-reference attribute is not mandatory.
In the following example, @Fields.Order has an OrderUI datatype, wich refers to the same data configured in OrdersLookup definition. The value type will be implicitly determined as a reference.
When selecting a value in the lookup, the value of @Fields.Order will be updated with the reference retrieved in the lookup.
<lookup name="OrdersLookup" value="@Fields.Order" label="myLabel" />
If the type of the bound value can't be implicitly determined as a reference or a scalar property, the is-reference attribute is mandatory.
In the following examples, the @Fields.Order.Customer data type can't be determined by the framework so the is-reference attribute has to be set to true or false to tell the lookup that the value is a reference or a scalar property.
Reference :
<lookup name="CustomerLookup" value="@Fields.Order.Customer" is-reference="true" label="myLabel" />
Scalar Property :
<lookup name="CustomerLookup" value="@Fields.Order.Customer.Name" is-reference="false" label="myLabel" />