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

Set a value programmatically after DataForm is loaded

3 Answers 98 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.
Yunuen Sanchez
Top achievements
Rank 1
Yunuen Sanchez asked on 24 May 2016, 05:11 PM

Hello guys,

I would like to modify a value on a field after the form is loaded. The user will touch a button and after some calculations the final result will update another editor on the dataform. 

I tried the method UpdateEditorForProperty + ReloadData, but only works if the no other field has been manually updated.

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Adrian
Telerik team
answered on 27 May 2016, 11:51 AM
Hi, Yunuen,

Thank you for writing.
You can easily edit a property value when another property is edited by using the valueCandidate property of TKEntityProperty and implementing dataForm:didCommitProperty: method of TKDataFormDelegate. Consider the code below:
- (void)dataForm:(TKDataForm *)dataForm didCommitProperty:(TKEntityProperty *)property
{
    if ([property.name isEqualToString:@"password"]) {
        _dataSource[@"secure"].valueCandidate = @(YES);
    }
}


Regards,
Adrian
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yunuen Sanchez
Top achievements
Rank 1
answered on 31 May 2016, 06:11 PM

Thank you Adrian! The valueCandidate property is the one I was looking for.

0
Adrian
Telerik team
answered on 02 Jun 2016, 08:30 AM
Hello, Yunuen,

I am happy that i could help. Since the issue is solved I am going to close this thread.

Regards,
Adrian
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataForm
Asked by
Yunuen Sanchez
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Yunuen Sanchez
Top achievements
Rank 1
Share this question
or