Axelor Doc

Widgets selection

Widgets selection

  • RadioSelect - applicable to a selection field
  • NavSelect - applicable to a selection field, this widget is useful to view the current status of a process, with the various states displayed from left to right (or top to bottom).
  • MultiSelect - applicable to a selection field, the final value will be a single string containing all selected by the comma separated user input.
  • RefSelect - this widget allows you to reference a record belonging to particular entities.

RadioSelect

For vertical display use the additional guidance in brackets widget="RadioSelect[direction=vertical]" RadioSelect

NavSelect

MultiSelect

MultiSelect

RefSelect

The case of typical use of this widget is to reference a record belonging to particular entities. For example, to associate an email address to a client or user (entities Customer and User).

Example:

Defining entities with refSelect
<entity name="Email">
...
  <string  name="ref" selection="selection.email.ref" />
  <integer name="refId" />
...
</entity>

Two fields are required, a string for the type of the referenced entity and an integer for the id of the referenced record.

Recommended for the entire field naming convention is: <nomDuChampReference> Id .

Selecting a refSelect
<selection name="selection.email.ref">
  <option value="com.axelor.contact.db.Contact">Contact</option>
  <option value="com.axelor.auth.db.User">User</option>
</selection>
Using a refSelect in a form view
<form title="...">
...
  <field name="ref" title="Reference" widget="RefSelect[related=refId]"/>
...
</form>

The attribute related widget is optional if the name of the entire field used for this purpose in the entity following the recommended naming convention.

The attribute selection can be redefined in the view. Widgets selection