Completed
Last Updated: 03 Nov 2023 23:41 by Arash
Release 4.2.0 (04/26/2023)
Stewart
Created on: 16 Mar 2023 09:14
Category: Form
Type: Bug Report
16
Form reorders items and custom markup

When I updated to the latest version I noticed that the FormItems in AuthorizedViews were moved to the bottom of the form, Quick example:

<TelerikForm>
    <FormItems>
        <AuthorizeView>
            <Authorized>
                <FormItem Field="First"/>
            </Authorized>
        </AuthorizeView>
        <FormItem Field="Second"/>
    </FormItems>
</TelerikForm>

will end up like

<TelerikForm>
    <FormItems>
        <FormItem Field="Second"/>
        <FormItem Field="First"/>
    </FormItems>
</TelerikForm>

11 comments
Arash
Posted on: 03 Nov 2023 23:41

I upgraded a few months ago and ran into the same issue! All custom and dynamically generated forms stop working. I had to downgrade and wait but still the same issue with V4.6.0!

Could you please just bring the old form back with a new name like 'TelerikBasicForm' or 'TelerikSimpleForm' or something like that?

Please leave it to the developers to select and use either one.

 

Brandon
Posted on: 05 Sep 2023 18:51

Every form in our application is now broken as well. I hope another solution is found because I can't justify going from the simple, straightforward markup in 4.0.1 to the 4.2.0 markup shown in the documentation. Not when we have many forms with dozens of controls.

If we have to refactor all of our forms across multiple projects (800+) because of this, we'll probably do it without Telerik.

Mikkel
Posted on: 31 Aug 2023 13:55

Hi Victor

we ended up creating a simple form control based on Telerik's but without the actual form control - not ideal, but workable until this is maybe fixed.

razor:

@using Telerik.Blazor.Components.Form
@*@page "/form/templates"*@
@inject NavigationManager NavigationManager

<div class="demo-section">
    <form class="k-form telerik-blazor k-form-md" style="">
        <FormGridLayout Columns="@Columns" ColumnSpacing="@ColumnSpacing">
            <CascadingValue Value="@EditContext">
                <CascadingValue Value="@Model">
                    <CascadingValue Name="FormContainer" Value="@this" IsFixed="true">
                        @FormItems
                    </CascadingValue>
                </CascadingValue>
            </CascadingValue>
        </FormGridLayout>
    </form>
</div>

code:


    public partial class Form : IFormContainer
    {

        [Parameter]
        public object Model { get; set; }

        [Parameter]
        public RenderFragment FormItems { get; set; }        

        [Parameter]
        public EditContext EditContext { get; set; }
        [Parameter]
        public RenderFragment FormValidation { get; set; }
       
        [Parameter]
        public TelerikForm FormRef { get; set; }

        [Parameter]
        public int Columns { get; set; }

        [Parameter]
        public string ColumnSpacing { get; set; }

        #region Unused
        /// <summary>
        /// These parameters are required from Telerik version 4.1 and up - we do not use them for anything, but they are required to use Teleriks form items
        /// </summary>
        public FormValidationMessageType ValidationMessageType { get; set; } = FormValidationMessageType.None;
        public string Size { get; set; }

        public List<IFormItemBase> FormItemsCollection { get; } = new List<IFormItemBase>();

        public void AddFormItem(IFormItemBase item)
        {
        }

        public IEnumerable<IFormItemBase> GetAutogeneratedItemsFromModel()
        {
            return FormItemsCollection;
        }

        public void RemoveFormItem(IFormItemBase item, bool isAutoGenerated = false)
        {
        }

        #endregion
    }

 

Víctor
Posted on: 31 Aug 2023 11:31

You guys just broke all my forms in my application with this breaking change... not cool at all.

Dale
Posted on: 21 Jun 2023 13:23
I would also agree with Mikkel. Being able to disable Autogenerated columns would be perfectly acceptable to get back that previous functionality.
Mikkel
Posted on: 20 Jun 2023 09:11

Hi Dimo

We don't really need the ability to have any autogenerated form items, so it would not need to work in conjunction with that. Would it be possible for you to maybe have it as an option to disable the autogeneration and set the form control to "manual" mode? That would fix this issue for us. Otherwise we will probably have to move away from using your form and just make our own version.

Best Regards

Mikkel

ADMIN
Dimo
Posted on: 01 Jun 2023 08:15

Hi Mikkel,

I am sorry that the change requires a lot of refactoring on your side. I realize this comes as an unexpected development effort for you.

The current solution is the best that we came up with, in order to support both conflicting features at the same time, even though custom markup inside the Form used to work "automagically" and unofficially. Otherwise we will need two separate Form components, or one public-facing Form with two separate internal algorithms. Both options represent a considerable overhead with questionable business value.

Regards,
Dimo
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Mikkel
Posted on: 01 Jun 2023 07:12
We have a similar issue when upgrading to the 4.2.0 version from 4.0.1. As we have a a lot of forms (300+) in the enterprise application we are building, the implications of the 4.2.0 change is massive. It will most likely be easier for us to build our own form that supports custom content, than refactoring the forms.
ADMIN
Dimo
Posted on: 02 May 2023 05:13

Hello everyone,

When moving to version 4.2.0 or later, please refer to this new documentation article and especially these two sections:

Regards,
Dimo
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
ADMIN
Dimo
Posted on: 22 Mar 2023 12:16

Hello Stewart,

With version 4.1.0 we released a desired feature - combine auto-generated form items together with manually declared ones:

As a side effect, the new feature broke an approach that customers used before - the ability to put arbitrary content inside the <FormItems> RenderFragment. This wasn't originally intended to be officially supported, although I agree that it makes sense to do so, and we have even suggested it to customers in some cases.

We are now researching how to restore the old behavior together with the new feature.

    My recommendation is to keep an eye on our release notes and updated documentation for an official confirmation once the fix is included in the product, which may be as early as the next release in April.

    Please accept our apologies if the current situation is causing you trouble. As a temporary workaround, you can:

    • Stay with version 4.0.1; or
    • Move the whole <AuthorizeView> logic outside the Form. This will require Form markup duplication.

    (I renamed the title to be more general.)

    Regards,
    Dimo
    Progress Telerik

    Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

    James
    Posted on: 17 Mar 2023 16:58
    I have a similar issue where the formitems that are in a TabStrip control display at the bottom and outside the tab content area. Rolled back to previous version to get it back to working.