To set the value, apply any of the following approaches:
- Use the
valueproperty. If the value is set through the
valueproperty, you have to hook up to the
valueChangeevent and manually update the value of the
- Use the
ngModelvalue binding. If the value is set by the
ngModelvalue binding, the framework will automatically update the corresponding field from the model after the value of the component changes.
- Use the
formControlNamevalue binding, which is available in the Reactive forms. If the value is set by the
formControlNamevalue binding, the framework will automatically update the corresponding field from the form model after the value of the component changes.
- The MultiColumnComboBox does not support the simultaneous usage of the
valueproperty and the
- The MultiColumnComboBox does not support values, which contain
\nnew line characters. The regular
inputHTML DOM element, which the MultiColumnComboBox uses internally treats
\nas a regular whitespace. Therefore, when the component compares the value of the
inputelement with the data item that is selected by the user, the two values differ. The value of the
inputelement is actually not present in the data of the component and the MultiColumnComboBox does not recognize it. To handle such issues, map the incoming data so that it contains regular whitespaces only.
As the MultiColumnComboBox can only be data-bound to object values, the component will expect to be bound to an object value as well by default.
The following example demonstrates how to use as component value the
id field value of the provided objects.
If the value, which is assigned through the
In the following example, the
valuePrimitive is not set to
- Provide the complete object as value.
- Set the
The following table lists the valid configuration scenarios.
|object||objects||Not set (automatically calculated as |
The text value, which is assigned through the
[(ngModel)] inputs and which is not found in the dataset will not be resolved. Such values also include object values that contain the
textField property, when
allowCustom is set to
The following example demonstrates how to merge the assigned value with the dataset and ensure that its text will be properly extracted and displayed.