Hi!
I searched the forum but found no answer. I have several controls in the form, each one inserted according to the scheme:
<div fxFlex="30">
<kendo-formfield [orientation]="'horizontal'">
<kendo-label text="Rodzaj przewozów">
<kendo-dropdownlist #transportTypeDropdown class="transport-type" [data]="transportTypes"
[textField]="'name'" [valueField]="'id'" [formControlName]="formNames.transportType"
[(value)]="formModel.transportType" [disabled]="areControlsDisabled">
</kendo-dropdownlist>
</kendo-label>
<app-form-error [controlName]="formNames.transportType" [form]="form"></app-form-error>
</kendo-formfield>
</div>
<div fxFlex="10">
<kendo-formfield [orientation]="'horizontal'">
<kendo-label text="wyszukaj bez trasy">
<input type="checkbox" #searchWithoutRouteCheckbox class="search-without-route-type"
[formControlName]="formNames.searchWithoutRoute" [value]="formModel.searchWithoutRoute" kendoCheckBox
[disabled]="areControlsDisabled" />
</kendo-label>
<app-form-error [controlName]="formNames.searchWithoutRoute" [form]="form"></app-form-error>
</kendo-formfield>
</div>
<div fxFlex="10">
<kendo-formfield [orientation]="'horizontal'">
<kendo-label text="Przes. kal. 2">
<kendo-dropdownlist #calendarShiftDropdown class="calendar-shift" [data]="calendarShiftItems"
[textField]="'text'" [valueField]="'value'" [formControlName]="formNames.calendarShift"
[valuePrimitive]="true" [(value)]="formModel.calendarShift" [disabled]="areControlsDisabled">
</kendo-dropdownlist>
</kendo-label>
<app-form-error [controlName]="formNames.calendarShift" [form]="form"></app-form-error>
</kendo-formfield>
</div>
and I get errors in the console:
The `kendo-formfield` component should contain only one control of type NgControl with a formControlName
AFAIS there's no doubled controls in formfield. In other form I have simmilar controls and getting no errors and I'm stuck on this issue. What I'm doing wrong?
Hi Robert,
I am not able to find any issues in the HTML markup, in such case it might be a binding typo which can cause such issues if there is mistake in the spelling.
Could you provide a runnable example demonstrating the error? That will help me troubleshoot the application and possibly find the root cause of the issue. Thank you in advance for your cooperation.
Regards,
Yanmario
Progress Telerik
In my case, there was no control of type NgControl with a formControlName
(I had a <kendo-numerictextbox>, but it was using: [value]="formGroup.get('wineGallons')?.value", isntead of [formControlName])
So I think "only one" was confusing me; a message like this might've helped me find the issue faster:
> The `kendo-formfield` component is missing a control of type NgControl with a formControlName
Hi Nathaniel,
I am happy to hear that you were able to resolve the error. With the error sometimes it is hard to determine the root cause and some troubleshooting would be required like removing some of the components to see which could be causing the issue.
I will write this down and raise this matter in our next developer meeting if the error message can be improved with better context.
Regards,
Yanmario
Progress Telerik
Hi Nathaniel & Yanmario!
I can confirm that my error was appearing due to missing formControlName on the form control. Thank you for your help!
Hi there!
This error shouldn't exist for fields with just value, without formControlName. This error in this case just a destruction, it bloats console with lots of duplicates. Now it throws an error to console, but it shouldn't because I pass value to the field through [value] binding.
Hi Sergey,
At this current time, there isn't an update on this matter and I cannot promise that improvements in the error messages will be implemented in the following releases. The team would need to discuss this matter and decide if improvements are needed at this stage.
Regards,
Yanmario
Progress Telerik