## Reference

### Description

The reference widget in EEF lets you display and edit a mono-valued or multi-valued EReference easily. On top of the common properties of all widgets (identifier, labelExpression, helpExpression, isEnabledExpression, propertyValidationRules), it has the following properties:

- multiple: Indicate if we should create a widget for the mono-valued use case or the multi-valued use case. While the description is the same, both widgets will have a very different implementation.
- valueExpression: With the mono-valued version of this widget, the value will be used to compute a read-only label. With the multi-valued version, all the valued will be displayed in a table. This expression must return an object.
- displayExpression: This expression is used to compute the read-only label of the mono-valued version and each label of the table in the multi-valued version. In both cases, each value will be available using the variable `value`. This expression must return a string.
- onClickExpression: This expression will be executed when the user will click on the value. With the multi-valued version of the widget, the user will be able to double click on a value. To determine whether the click on a single click or a double click, the kind of the click realized is available as a String in the variable `onClickEventKind` which can have the value `SINGLE_CLICK` or `DOUBLE_CLICK`. This expression does not have to return anything.
- actions: The actions are a list of buttons which will be available next to the widget to allow the user to trigger some actions for the reference. The specifier can use those actions in order to create a new instance of the value of the reference, to unset it, etc. An action has a labelExpression which must return a string used as the label of the button created for the action. An action also has an action expression used to execute some behavior when the end user will click on the button. The action expression does not have to return anything. The action expression will have access to the selected elements in a variable named `selection`.
- style: The style of the reference widget.
- conditionalStyles: All the conditional styles of the reference widget.

### Display an EReference

In order to display in the user interface a reference widget with the value of a multi-valued EReference, you can create a reference widget with the following properties:

- multiple: `true`
- labelExpression: `aql:'Children'`
- valueExpression: `aql:self.children`
- displayExpression: `aql:value.name`