This is a migrated thread and some comments may be shown as answers.

TKPropertyGroup not working on IOS

8 Answers 73 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vamsi
Top achievements
Rank 1
Vamsi asked on 08 Jun 2017, 08:32 AM

Below HTML is perfectly working on Android but giving exception "JS ERROR TypeError: null is not an object (evaluating 'group.collapsible')" on IOS

 

<ActionBar title="Register Patient" class="action-bar">
<NavigationButton text="Go Back" android.systemIcon="ic_menu_back" (tap)="cancel()"></NavigationButton>
<ActionItem (tap)="submit()" class="btn btn-rounded-lg btn-active" text="Submit"
android.position="actionBar"></ActionItem>
</ActionBar>

<StackLayout>
<StockLayout orientation="horizontal">
<Label #resultLabel class="labelError"></Label>
</StockLayout>
<ScrollView orientation="vertical">
<RadDataForm #registerPatientRuntimeForm tkToggleNavButton [source]="patient" (loaded)="onFormLoaded($event)">
<TKPropertyGroup tkDataFormGroups collapsible="true" name="Patient" hidden="false">
<TKEntityProperty tkPropertyGroupProperties name="nationalId" displayName="SA ID">
<TKPropertyEditor tkEntityPropertyEditor type="Text" length="13"></TKPropertyEditor>
<TKMinimumLengthValidator tkEntityPropertyValidators
errorMessage="SA ID number must be 13 digits long."
length="13"></TKMinimumLengthValidator>
</TKEntityProperty>
<TKEntityProperty tkPropertyGroupProperties name="firstName" displayName="First Name"
hintText="First Name">
<TKPropertyEditor tkEntityPropertyEditor type="Text"></TKPropertyEditor>
<TKNonEmptyValidator tkEntityPropertyValidators errorMessage="First Name is Mandatory"
length="1"></TKNonEmptyValidator>
</TKEntityProperty>
<TKEntityProperty tkPropertyGroupProperties name="middleName">
<TKPropertyEditor tkEntityPropertyEditor type="Text"></TKPropertyEditor>
</TKEntityProperty>
<TKEntityProperty tkPropertyGroupProperties name="lastName">
<TKPropertyEditor tkEntityPropertyEditor type="Text"></TKPropertyEditor>
<TKNonEmptyValidator tkEntityPropertyValidators errorMessage="Last Name is Mandatory"
length="1"></TKNonEmptyValidator>
</TKEntityProperty>
</TKPropertyGroup>

</RadDataForm>
</ScrollView>
</StackLayout>

8 Answers, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 08 Jun 2017, 10:28 AM
Hi Vamsi,

Thank you for reporting this issue! We have made a research and I can confirm that indeed this is a bug in the iOS implementation of groups for RadDataForm. I have logged the bug here, where you can track its development and see when a fix or stable solution will be released.

Meanwhile, I have made some further observations and it seems that the bug is only reproducible when you are trying to create a group (or groups) in iOS but without creating entity properties for all passed properties via the source.

As a temporary workaround, If you need to have one group and in the same time not to show all arguments in your source as entity properties you can create dummy group with all the "extra" properties and hide it using hidden="true"

e.g.
<TKPropertyGroup tkDataFormGroups collapsible="true" name="Patient" hidden="false">
    <!-- ... the entity properties you want to group and show -->
</TKPropertyGroup>
 
<!-- the whole group will be not be visible as the value of hidden is true -->
<TKPropertyGroup tkDataFormGroups collapsible="true" name="Patient" hidden="true">
    <!-- ... all other entity properties coming from your "source" -->
    <!-- that you want to hide and not to use in the form -->
</TKPropertyGroup>

I am awarding you Telerik points for discovering this bug and once again sorry for any inconvenience caused!

Regards,
Nikolay Iliev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
0
Vamsi
Top achievements
Rank 1
answered on 08 Jun 2017, 10:49 AM
Thank you Nikolay for quick response and the workaround.
0
Vamsi
Top achievements
Rank 1
answered on 26 Jun 2017, 05:27 PM

Hi Nikolay,

The suggested workaround doesn't seems to work for me, please see the attached html and entity class file. I've all the fields from the entity is added to the data form and I've moved the unused fields to hidden group. App is still crashing under IOS.

Thank you,

Vamsi

0
Nick Iliev
Telerik team
answered on 27 Jun 2017, 09:57 AM
Hi Varnsi,

The issue you are hitting (setting single group that does not contain all source values) is logged here - in my previous post I must have missed the link for which I apologize!
In the logged issue you can see that our developers have already released a fix for this issue which will be included in the next official release of the plugin.
Meanwhile, if you want to test the fix with your business logic you can do this by installing the next version of nativescript-telerik-ui-pro plugin.
e.g
rm- rf platforms
tns plugin remove nativescript-telerik-ui-pro
tns plugin add nativescript-telerik-ui-pro@next
tns build ios

Keep in mind the next tag is only for testing purposes and should not be used in production. |I hope you will find out that the fix fully resolves your issue without having to apply any workarounds - let is know if you need further instructions.

Regards,
Nikolay Iliev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
0
Vamsi
Top achievements
Rank 1
answered on 27 Jun 2017, 10:59 AM

Thank you Nikolay,

if I install the plugin using the below command, how do I install my license?
tns plugin add nativescript-telerik-ui-pro@next

Regards,

Vamsi.

0
Nick Iliev
Telerik team
answered on 27 Jun 2017, 11:04 AM
Hey ,

Use the next tag only for testing purposes and not for production/release.
While testing you'll use the trial version that will be installed with the next tag.

The official release that will include the fix is coming pretty soon and one released you will be able to install it as done up to this moment - by downloading the package from your account 

Regards,
Nikolay Iliev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
0
Vamsi
Top achievements
Rank 1
answered on 30 Jun 2017, 05:10 AM

Hi Nikolay,

I've upgraded my Nativescript UI Pro to 3.0.0.292, but the above attached code still crashing on iOS and working as expected on Android. Below is the error log when it crashed on iOS.

 

file:///app/tns_modules/nativescript-telerik-ui-pro/dataform/dataform.js:147:81: JS ERROR TypeError: undefined is not an object (evaluating 'entityProperty.editor.ios')
Jun 30 07:05:39 Vamsis-MacBook-Pro com.apple.CoreSimulator.SimDevice.49B56F4E-597B-45A4-AEC9-A62D34FDEE67.launchd_sim[14714] (UIKitApplication:org.nativescript.HealthScreening[0xb5df][14736][15216]): Service exited due to Segmentation fault: 11

Thank you,

Vamsi

0
Nick Iliev
Telerik team
answered on 30 Jun 2017, 08:29 AM
Hello ,

I've noticed that the error you are receiving now is different from the previous one
// new error
JS ERROR TypeError: undefined is not an object (evaluating 'entityProperty.editor.ios')
 
// old error
"JS ERROR TypeError: null is not an object (evaluating 'group.collapsible')

Which leads me to conclude that you are observing a different problem.
Please send us a sample project that reproduces the issue so we could investigate further the cause of the new error.

Meanwhile, the official release is now live which means you do not have to use the next tag. So you can safely remove the next version and install the official release.

I have also tested the described scenario (One form group that does not contains all properties - while the other properties are either part of a hidden group or not included in at al) and everything is working as expected. Here the exact steps I taken to make this work on iOS.

- using this example
- changing the code so that it will only show part of the properties in one group (while the others are either hidden or not part of a group)
Here is the modified code
<RadDataForm #myRuntimeDataFormComp tkExampleTitle tkToggleNavButton [source]="person" row="1">
    <!-- visible group -->
    <TKPropertyGroup tkDataFormGroups collapsible="true" name="Main Info" hidden="false">
        <TKEntityProperty tkPropertyGroupProperties name="name">
            <TKPropertyEditor tkEntityPropertyEditor type="Text"></TKPropertyEditor>
        </TKEntityProperty>
        <TKEntityProperty tkPropertyGroupProperties name="age">
            <TKPropertyEditor tkEntityPropertyEditor type="Number"></TKPropertyEditor>
        </TKEntityProperty>
        <TKEntityProperty tkPropertyGroupProperties name="email">
            <TKPropertyEditor tkEntityPropertyEditor type="Email"></TKPropertyEditor>
        </TKEntityProperty>
    </TKPropertyGroup>
 
    <!-- hidden group -->
    <TKPropertyGroup tkDataFormGroups collapsible="true" name="Address" hidden="true">
        <TKEntityProperty tkPropertyGroupProperties name="city">
            <TKPropertyEditor tkEntityPropertyEditor type="Text"></TKPropertyEditor>
        </TKEntityProperty>
        <TKEntityProperty tkPropertyGroupProperties name="street">
            <TKPropertyEditor tkEntityPropertyEditor type="Text"></TKPropertyEditor>
        </TKEntityProperty>
 
        <!--<TKEntityProperty tkPropertyGroupProperties name="streetNumber">
            <TKPropertyEditor tkEntityPropertyEditor type="Number"></TKPropertyEditor>
        </TKEntityProperty>-->
        <!-- as the above commented property is not hidden it will be visualized outsie all groups! -->
        <!-- uncomment the property to add it in the hidden group to remove it from your RadDataForm-->
    </TKPropertyGroup>
</RadDataForm>


You can use this example as a reference and further isolate the reason for your new error.
Let me know if that helped and if you need further assistance please send us the project that is throwing the error (if possible).

Regards,
Nikolay Iliev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Tags
DataForm
Asked by
Vamsi
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Vamsi
Top achievements
Rank 1
Share this question
or