Set a value programmatically after DataForm is loaded

4 posts, 1 answers
  1. Yunuen Sanchez
    Yunuen Sanchez avatar
    31 posts
    Member since:
    Aug 2009

    Posted 24 May Link to this post

    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

  2. Answer
    Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 27 May Link to this post

    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
  3. DevCraft banner
  4. Yunuen Sanchez
    Yunuen Sanchez avatar
    31 posts
    Member since:
    Aug 2009

    Posted 31 May Link to this post

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

  5. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 02 Jun Link to this post

    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
Back to Top
DevCraft banner