Update TKDataFormDecimalEditor from another editor on commit

8 posts, 0 answers
  1. Sal
    Sal avatar
    58 posts
    Member since:
    Feb 2015

    Posted 13 Feb Link to this post

    I have a DataForm that uses a couple TKDataFormDecimalEditors, and I wanted to know if there's a way where I can update the other DecimalEditors values when another field is committed. In another scenario I was able to update the value of another DatePickerEditor by updating the valueCandidate of said editor, but I tried that here and it didn't work. 

    Here's what I tried

     

    override func dataForm(dataForm: TKDataForm, didCommitProperty property: TKEntityProperty) {
            //check which editor committed a value
            if property.name == "editor1" {
                //get the new value from the first editor
                let newValue = property.originalValue
                 
     
            let editor2 = self.dataSource["editor2"]
            let editor3 = self.dataSource["editor3"]
            let editor4 = self.dataSource["editor4"]
            //right now just set some set some arbitrary numbers for testing
            editor2.valueCandidate = newValue * 25
            editor3.valueCandidate = newValue + 55
            editor4.valueCandidate = newValue / 6
            }
     
            self.dataForm.update()
        }

  2. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 17 Feb Link to this post

    Hello, Sal,

    Thank you for contacting us.

    This issue is logged in our feedback portal and it will be addressed in a future version. Currently a possible workaround is to call data form's reloadData method instead of update.

    I hope this helps. If you need further assistance do not hesitate to contact us.

    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. Sal
    Sal avatar
    58 posts
    Member since:
    Feb 2015

    Posted 17 Feb in reply to Adrian Link to this post

    Thanks for the reply Adrian, do you happen to know if it would be at all possible that this will fix will make it into this months patch release or should I just wait for March's release to look for it? I can't really use the reloadData work around because whenever reloadData is called the keyboard is dismissed so the user can only type one number at a time.
  5. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 19 Feb Link to this post

    Hello, Sal,

    Our next release is scheduled for the beginning of March and the discussed functionality will be available.

    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
  6. Sal
    Sal avatar
    58 posts
    Member since:
    Feb 2015

    Posted 11 Mar Link to this post

    Hello Adrian, 

    I downloaded the updated version of the controls and now the update method is working, but on a side issue it looks when setting the value in the valueCandidate then the didCommit is called as well, which in my scenario is creating a endless loop until the app crashes since the 3 editors keep calling didCommit when trying to update the values of each other. 

  7. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 11 Mar Link to this post

    Hello, Sal,

    Could you please send me a sample project where this issue can be reproduced so I can investigate it further? Thank you in advance for your cooperation. I am looking forward to your reply.

    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
  8. Sal
    Sal avatar
    58 posts
    Member since:
    Feb 2015

    Posted 11 Mar in reply to Adrian Link to this post

    Actually Adrian I found the issue while working on the sample project to send you. It was my mistake, the method that I was using to update the editors was being called multiple times because of how I set it up, but now it's fixed and the DataForm is working correctly. Thanks. 
  9. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 14 Mar Link to this post

    Hello, Sal,

    Thank you for this feedback. I am glad that the issue is solved. In case you need further assistance, feel free to contact us again.

    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