Open the Viewer in design mode. Create the necessary columns and blocks where the DynSelect should be placed.
Press the 'Add' button and find the 'SimpleSwatSelect' and drag it to the correct place.
In this example it is a viewer on 'Adresstyp'. The field Adresstyp.Adrsubtyp_ID
is available in the table, but Adresstyp.Adrsubtyp
is a calculated field in the Business Entity and filled with the value of Adrsubtyp.Adrsubtyp
.
Select the SimpleSwatSelect input field and set the following attributes (be aware, some attributes are case-sensitive):
Attribute | Value | Explanation |
---|---|---|
name | adrsubtyp | The field which is initially displayed in the input field (closed DynSelect). In this case it is the calculated field |
EntityName | Osiv.BusinessLogic.ipar.AdrSubtyp.AdrSubtypBE | The Business Entity class of the 'child' table |
EntityTable | eAdrSubtyp | The 'child' table to populate the DynSelect with |
FieldLabel | Basistyp | The label to show in the viewer |
LookupKeyField | adrsubtyp | The field to be displayed after an entry is selected (normally the same as attribute 'name'). Can also be a comma-separated list of fields and constants, for example: |
LookupKeyValueBinding | adrsubtyp_id | This represents the DataSource (of the viewer) its DataField where the value from attribute 'LookupKeyValueColumn' will be stored in, in this case the relational |
LookupKeyValueColumn | adrsubtyp_id | The key field from the Business Entity of attribute 'Entityname', in this case the relational AdrSubtyp.Adrsubtyp_ID field |
Template | GenericAutocompleteSearchTemplateDynSelect | Possible other values are GenericAutocompleteSearchTemplateDynSelect_line (in-line dropdown) or GenericAutocompleteSearchTemplateDynSelect_checkbox (checkbox dropdown, useful for multiple selections) |
templateOptions | |adrsubtyp|bez | The format of an entry in the drop-down. The format is: The format can also contain constants, for example: |
VisualizationType | FILL-IN | |
WIDTH-CHARS | 230 | This is not the same as other fields. The value must be set much higher. |
LookupFields | A comma separated list of fields which will be assigned after an entry is selected. Those values will be saved as well | |
LookupControls | The corresponding UI controls of attribute 'LookupFields' | |
MULTIPLE | Allows selection of multiple values. When selecting multiple options, all of them will be saved as a separated list (see multiDelimiter) in the BE fields defined in attributes. | |
multiDelimiter | | | Specifies the delimiter used for multiple selections. Has to match the delimiter used on the backend. |
maximumSelectionLength | How many entries can be selected. Works only with attribute MULTIPLE (currently not implemented in a Viewer) | |
minimumInputLength | The minimum characters which must be typed before any result is displayed in the DynSelect | |
closeOnSelect | Leave the drop-down open or not. Nice feature with MULTIPLE attribute | |
tags | The value typed-in will be added to the drop-down list | |
initialFetch | Default expression when building the DynSelect for the first time. Works together with method Override the Be aware that the | |
onBeforeFetch | Event: This is an event which is triggered every time the DynSelect is opened. This is usefull when another DynSelect needs to use the value of another DynSelect. | |
validateEvent | Event: This event is triggered every time an entry is selected. This is usefull for validations | |
resultListMenuCode | Contains the name of a menu-structure, and will be displayed at the end of the DynSelect |
Multiple selection in Form
In order to enable multiple selection in Form, the 'multiple' attribute needs to be checked to 'true'.
The dynSelect attributes will work the same as before, but when selecting multiple options, all of them will be saved as a separated-list in the Form BE fields. The symbol/delimiter used when building the list can be specified in the 'multiDelimiter' attribute (space, comma, pipe, etc.). This delimiter needs to match the delimiter used on the backend.
On the back-end the received list has to be processed to fetch the other fields (see 'lookupControls' attribute) in order to be updated.
Example:
The request payload will look something like this:
To add a DynSelect as filter in a grid, the SmartComponent Object Master Maintenance window must be used. The Akioma Web Designer does not support this functionallity.
SimpleSwatSelect
AdrSubtyp
Select the SimpleSwatSelect input field and set the following attributes (be aware, some attributes are case-sensitive):
If the filter is based on LIST-ITEMS or LIST-ITEM-PAIRS, then the attributes EntityName, EntityTable,LookupKeyField, LookupKeyValueColumn, ObjectType, Template and TemplateOptions can be left blank. |
Attribute | Value | Explanation |
---|---|---|
CanFilter | true | To enable the DynSelect |
CanSort | Enable to have the column sortable | |
closeOnSelect | Leave the drop-down open or not. Nice feature with MULTIPLE attribute | |
EntityName | Osiv.BusinessLogic.ipar.AdrSubtyp.AdrSubtypBE | The Business Entity class of the 'child' table |
EntityTable | eAdrSubtyp | The 'child' table to populate the DynSelect with |
filter | #dynselect_filter | |
LABEL | Basistyp | The label of the column |
LookupKeyField | adrsubtyp | The field to be displayed after an entry is selected (normally the same as attribute 'name'). It will show the selected enty as a 'tag/label'. Can also be a comma-separated list of fields and constants, for example: |
LookupKeyValueColumn | adrsubtyp_id | The key field from the Business Entity, in this case the relational Adresstyp.Adrsubtyp_ID field |
MULTIPLE | Allows selection of multiple values. When selecting multiple options, all of them will be saved as a separated list (see multiDelimiter) in the BE fields defined in attributes. | |
multiDelimiter | | | Specifies the delimiter used for multiple selections. Has to match the delimiter used on the backend. |
multipleBehaviour | standard | Possible other values are: 'cell' or 'filter+cell'. Specifies in which cases the multiple attribute will be applied |
ObjectType | dynselect | |
Template | GenericAutocompleteSearchTemplateDynSelect | Possible other values are 'GenericAutocompleteSearchTemplateDynSelect_line' (in-line dropdown) or 'GenericAutocompleteSearchTemplateDynSelect_checkbox' (checkbox dropdown, useful for multiple selections) |
TemplateOptions | |adrsubtyp|bez | The format of an entry in the drop-down. The format is: The format can also contain constants, for example: |
For other attributes see the chapter above with the DynSelect in a Viewer