Validation doubt

2 posts, 0 answers
  1. Alexandre
    Alexandre avatar
    1 posts
    Member since:
    Sep 2014

    Posted 16 Jan Link to this post

         Hello,

     

    I set up all the validation that I need on my form. The issue is I have a button that a user can tap anytime, so when he taps I need to know if all the form is validated, how to do that, without validating the Business object, and repeating the validating code that I set up for the propertys.

     Just for clarification, when the user focus on field, and leave the field all the validation is working as expected, the issue is when he tries to save, how can I know that all my properties had been validated already.

     

    Thanks in advance

  2. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 20 Jan Link to this post

    Hello, Alexandre,

    Thank you for contacting us.

    The described scenario can be achieved by iterating through the properties in the form and using the isValid property of TKEntityProperty. Please consider the code snippet below:
    BOOL isValidForm = YES;
       for (TKEntityProperty *property in _dataSource.properties) {
           if (!property.isValid) {
               isValidForm = NO;
               break;
           }
       }

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