0
votes

I also posted this as a NativeScript issue, but nobody seems to care up there so far. I hope somebody might have a workaround for this issue.

RadDataForm does not bind properly on iOS when navigating back to the component with the form. After navigating back, you can change values in the form fields, but these values aren't propagated into the source object.

To Reproduce Open the playground project: Fill a value on "test" and click "Test" to verify. Then click "Next" to navigate away. Then click "back" and try to update the value on "test", the binding is now gone and "Test" (or anything else) won't update the value of the source variable anymore.

Expected behavior Source variable should be updated after navigating back to the form and changing values.

Sample project https://play.nativescript.org/?template=play-ng&id=vwLAH9&v=3

Issue Nativescript: https://github.com/NativeScript/nativescript-ui-feedback/issues/1350

1
Curiously, your label also doesn't update through its data binding in realtime like it should. - Ian MacDonald
I guess all the changes are done outside zone, so it does not update in real time. - Manoj

1 Answers

1
votes

I had a peek and looks the the native iOS delegate is set to null when the DataForm is unloaded but it's not being set back on loaded event, that stops event the events on the form after back navigation. A simple workaround is setting the delegate on loaded event.

onDataFormLoaded(event) {
    const dataForm = event.object;
    if (dataForm._ios && dataForm._nativeDelegate && !dataForm._ios.delegate) {
        dataForm._ios.delegate = dataForm._nativeDelegate;
    }
}

Updated Playground