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

Validation doubt

1 Answer 33 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.
Alexandre
Top achievements
Rank 1
Alexandre asked on 16 Jan 2016, 06:01 AM

     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

1 Answer, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 20 Jan 2016, 11:47 AM
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
Tags
DataForm
Asked by
Alexandre
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Share this question
or