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

[RadDataForm] list of value options for value providers using Vue #1208

Closed scebotari66 closed 5 years ago

scebotari66 commented 5 years ago

Tell us about the problem

The docs specify that there are four options you can use to set the values provider:

Here are the options to provide the list of values:

Array with Values Map with Values and the Labels for Them Array with Key-Label Pairs Array with Custom Objects

It seems that only the first type (array with values) is supported for "nativescript-ui-dataform/vue".

Which platform(s) does your issue occur on?

Both

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. Start the playground application
  2. Notice that only the first picker field ("Array With Values") renders the values as expected. Note: for the "Array with Custom Objects" the valuesProvider config is commented out because it raises the following exception:

An uncaught Exception occurred on "main" thread. Calling js method onCreateView failed Error: java.lang.ClassCastException: org.json.JSONObject cannot be cast to org.json.JSONArray

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

https://play.nativescript.org/?template=play-vue&id=MqEAeX

msaelices commented 5 years ago

@scebotari66 Actually all the options for valuesProvider work. See this sample which shows how you can define them: https://github.com/NativeScript/nativescript-ui-samples-vue/pull/127

scebotari66 commented 5 years ago

Thanks @msaelices for the sample. Indeed, like that it works. But this seems more like a workaround to me. In the documentation examples the valuesProvider option is specified in form metadata via propertyAnnotations, which still does not work. Is the documentation outdated or we are still looking at a bug here?

msaelices commented 5 years ago

@scebotari66 I guess that the propertyAnnotations are not capable of handling all the customization options which as the template markup. Probably @elena-p or some other core members are able to answer you better than me.

tgpetrov commented 5 years ago

@scebotari66 The documentation article includes a sample where the valuesProvider which is part of the propertyAnnotation is in the form of array of strings. It is the only supported format for valuesProvider when it is included in the metadata (propertyAnnotations).

While the documentation doesn't explicitly state it, the other samples are showing how to use other formats of valuesProvider, but they are not part of the metadata and are only intended to be used as in the example @msaelices sent you.

There is a feature request here for supporting the other formats of valuesProvider as part of the metadata, but it is not yet implemented.

scebotari66 commented 5 years ago

Thanks, @msaelices and @tgpetrov for the clarifications. I think the docs should mention this somehow. As NativeScript newbie, I started using RadDataForm with editors custmozied via propertyAnnotations because this is the way you see it in the documentation. And then you want to customize the valuesProvider and you are lost.

tgpetrov commented 5 years ago

@scebotari66 Yes we should clarify this in the docs.

mannok commented 5 years ago

Anyone is going to finish this on Vue? DataForm is a very important feature in mobile. If the RadDataForm cannot fully work with these frontend framework. It may affect the development cycle so much.