10 Answers, 1 is accepted
Does your scenario include loading remote data or loading data from files? Could you, please, give us more details about what you are aiming to achieve with the TKDataForm, this way we can assist you and provide you with proper solution in short terms.
Looking forward to hearing from you.
Regards,
Sophi
Telerik
TKDataForm allows you to change the sourceObject any time and just call the reloadData method of the TKDataForm. You can change the sourceObject at runtime with the updated one, or even create a new instance of the TKDataFormEntityDataSource with a sourceObject out of JSON input.
You can refer to this example for the JSON support feature.
Regards,
Sophi
Telerik
Currently the TKDataForm can be loaded only from a single source object or JSON. You cannot have different groups loaded from separate sources.
When you get the remote data you should create a source object or feed directly the TKDataForm with NSDictionary or JSON file and then reload it by calling the reloadData method.
Regards,
Sophi
Telerik by Progress
Hello Sophi, do you have an example of how to create the source object? The example that you mencioned before is based on a JSON struct. But i want to add properties to my current BO or create a new BO with more properties recived dinamically. I think that is using the TKEntity Class, but i don't have any idea about how this works.
Greetings and thanks.
Here's an example that populates the data form without json. When you need to update the data form with another object with different properties, you just need to create a new data source from the new object and then assign it to the data form.
Let us know if you need further assistance.
Regards,
Todor
Telerik by Progress
Hello Todor.
For my understanding, this example that you are sharing me, has an BO defined previously. And the thing is, that i want to add properties defined on the fly to my existent BO. For example, if i have a catalog with one or many sub levels, i want to create that sub levels on my form. I don't know the number of levels, until my method returns from server. So if i define a BO previously, how can i add properties that don't exist on it?
thanks a lot for your help and pacient.
Thank you for writing back.
The DataForm is always related to a single business object and there is no option to have an editor in the data form that is not related to a property from your business object. The options that you have to populate a data form are:
1) through an instance of a class that represents your business object
2) through json string
If your business object needs to be updated runtime, you still need to use one of the above mentioned approaches. Here's what to do for each of them:
1) you can create the new class at runtime as demonstrated here and pass an instance of it to the data form
2) you can create a json from the information that you have and pass the json to the data form
I hope this information helps.
Regards,
Todor
Telerik by Progress