ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

Dataform - index 0 beyond bound with groups #1166

Closed jelledijkstra97 closed 5 years ago

jelledijkstra97 commented 5 years ago

Please, provide the details below:

I'm using a data form from the plugin and I wan't to use groups. However when I navigate to the page with the form, the app crashes with the following error:

ERROR Error: *** -[__NSArrayM objectAtIndexedSubscript:]: index 0 beyond bounds for empty array

Without using groups everything works as expected.

Which platform(s) does your issue occur on?

iOS (Haven't tested Android)

Please provide the following version numbers that your issue occurs with:

Please tell us how to recreate the issue in as much detail as possible.

  1. Navigating to the page holding the data form

This is a part of my html. When commenting out the PropertyGroup it works fine.

tsonevn commented 5 years ago

Hi @jelledijkstra97, I tested the described case with our sample app, however, I was unable to recreate a problem with it. Regarding that, it will help if you can send us a sample project, where the issue can be recreated and can be used for debugging.

jelledijkstra97 commented 5 years ago

Thanks for your reply. Here is a link to a project with just the troubled page: https://firebasestorage.googleapis.com/v0/b/schedules-912ea.appspot.com/o/dataform-test.zip?alt=media&token=d62958e0-62c6-49eb-ba3b-2c6e401400bd

tsonevn commented 5 years ago

Hi @jelledijkstra97, Thank you for the attached sample project. I reviewed it and found out that the wrong directive is used while setting up the EntityProperties with the grouping option. To solve the issue, you can replace tkDataFormProperty with tkPropertyGroupProperties. For example: new-challenge.component.html

......
 <RadDataForm [source]="challenge">
        <TKPropertyGroup tkDataFormGroups collapsible="false" name="Verborgen" hidden="true">
            <TKEntityProperty tkPropertyGroupProperties name="id"></TKEntityProperty>
            <TKEntityProperty tkPropertyGroupProperties name="productId"></TKEntityProperty>
            <TKEntityProperty tkPropertyGroupProperties name="standing"></TKEntityProperty>
            <TKEntityProperty tkPropertyGroupProperties name="categoryId"></TKEntityProperty>
            <TKEntityProperty tkPropertyGroupProperties name="start"></TKEntityProperty>
            <TKEntityProperty tkPropertyGroupProperties name="end"></TKEntityProperty>
        </TKPropertyGroup>

        <TKPropertyGroup tkDataFormGroups collapsible="true" name="Uitdaging" hidden="false">

            <TKEntityProperty tkPropertyGroupProperties name="category" displayName="Categorie" [valuesProvider]="categories">
                <TKPropertyEditor tkEntityPropertyEditor type="List"></TKPropertyEditor>
            </TKEntityProperty>

            <TKEntityProperty tkPropertyGroupProperties name="product" displayName="Product" [valuesProvider]="categories">
                <TKPropertyEditor tkEntityPropertyEditor type="List"></TKPropertyEditor>
            </TKEntityProperty>

            <TKEntityProperty tkPropertyGroupProperties name="comment" displayName="Opmerking">
                <TKPropertyEditor tkEntityPropertyEditor type="MultilineText"></TKPropertyEditor>
            </TKEntityProperty>

        </TKPropertyGroup>

        <TKPropertyGroup tkDataFormGroups collapsible="true" name="Start" hidden="false">

            <TKEntityProperty tkPropertyGroupProperties name="startDate" displayName="Datum">
                <TKPropertyEditor tkEntityPropertyEditor type="DatePicker"></TKPropertyEditor>
            </TKEntityProperty>

            <TKEntityProperty tkPropertyGroupProperties name="startTime" displayName="Tijd">
                <TKPropertyEditor tkEntityPropertyEditor type="TimePicker"></TKPropertyEditor>
            </TKEntityProperty>

        </TKPropertyGroup>

        <TKPropertyGroup tkDataFormGroups collapsible="true" name="Eind" hidden="false">

            <TKEntityProperty tkPropertyGroupProperties name="endDate" displayName="Datum">
                <TKPropertyEditor tkEntityPropertyEditor type="DatePicker"></TKPropertyEditor>
            </TKEntityProperty>

            <TKEntityProperty tkPropertyGroupProperties name="endTime" displayName="Tijd">
                <TKPropertyEditor tkEntityPropertyEditor type="TimePicker"></TKPropertyEditor>
            </TKEntityProperty>

        </TKPropertyGroup>
    </RadDataForm>
......
jelledijkstra97 commented 5 years ago

Thanks so much! Followed the docs without groups first and added the groups later on but didn't pay attention to any directive changes...