SAP / ui5-webcomponents-ngx

UI5 Web Components for Angular provides directives for each UI5 Web Component. The directives allow to easily build your Angular application following the SAP Design System.
https://ui5-webcomponents-ngx.netlify.app/
Apache License 2.0
27 stars 5 forks source link

[Combobox, MultiCombobox]: No FormControl support #91

Closed ilhan007 closed 10 months ago

ilhan007 commented 1 year ago

Created the issue on behalf of SAP Build Process Automation: Combobox, MultiCombobox - FormControl support is missing.

Expected Behavior

Steps to Reproduce

  1. Go to '...'
  2. ...
  3. ...

Isolated Example

Context

Log Output / Stack Trace / Screenshots

{...}

Priority

The priority indicates the severity of the issue. To set the appropriate priority consider the following criteria:

Note: The priority might be re-evaluated by the issue processor.

Stakeholder Info (if applicable)

github-actions[bot] commented 1 year ago

Hello @ilhan007, thank you for using ui5-webcomponents-ngx! The ui5-webcomponents-ngx team will triage your issue as soon as possible.

ilhan007 commented 1 year ago

Hello @droshev this is one of the latest issues raised. Meanwhile I will ask the authors for more information. Thank you.

ilhan007 commented 1 year ago

Hello @timogeib

The following works for me with the ComboBox:


<ui5-combobox [formControl]="cbxControl">
        <ui5-cb-item value="phone" text="Phone"></ui5-cb-item>
        <ui5-cb-item value="tablet" text="Tablet"></ui5-cb-item>
        <ui5-cb-item value="desktop" text="Desktop"></ui5-cb-item>
 </ui5-combobox>
 FormControl value: {{ cbxControl.value }}, touched: {{ cbxControl.touched }}
<button (click)="updateCbxFormModel()">cbxControl.setValue("phone")</button>

import { Component } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';

@Component({
  selector: 'reactive-form-sample',
  templateUrl: './reactiveFormSample.component.html',
})
export class ReactiveFormsSample {

  cbxControl = new FormControl('desktop');

  updateCbxFormModel() {
    this.cbxControl.setValue("phone");
  }
}

https://github.com/SAP/ui5-webcomponents-ngx/assets/15702139/46400410-73ca-4a1d-85ed-05623e2e07e8

timogeib commented 1 year ago

@ilhan007 Please be aware of the touched flag, which will not be set to true...

g-cheishvili commented 10 months ago

All works, except the fact that the value should be something. It can not be undefined or null and if that's the problem, the issue should be recorded in @ui5/webcomponents repository