This commit is contained in:
Suresh, Kamlesh 2019-11-07 10:45:40 -05:00
parent 10fe33748f
commit a212dff80f
4 changed files with 9 additions and 3 deletions

View File

@ -669,7 +669,7 @@
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
self.validationRequired = [json boolForKey:@"validationRequired"];
self.validationRequired = [json boolForKey:@"required"];
self.requiredGroupsList = [json array:@"requiredGroups"];
[FormValidator setupValidationWithMolecule:self delegate:delegateObject.formValidationProtocol];

View File

@ -19,6 +19,7 @@ import MVMCore
// Form Validation
var isRequired = false
var fieldKey: String?
var fieldValue: String?
var groupName: String?
var delegateObject: MVMCoreUIDelegateObject?
@ -407,6 +408,7 @@ import MVMCore
guard let dictionary = json else { return }
groupName = dictionary.optionalStringForKey("groupName")
fieldValue = dictionary.optionalStringForKey("value")
if let fieldKey = dictionary[KeyFieldKey] as? String {
self.fieldKey = fieldKey
}
@ -475,6 +477,6 @@ extension Checkbox: FormValidationFormFieldProtocol {
}
public func formFieldValue() -> Any? {
return NSNumber(value: isSelected)
return isSelected ? fieldValue : nil
}
}

View File

@ -423,6 +423,10 @@ const CGFloat SwitchShakeIntensity = 2;
return UIAccessibilityTraitButton;
}
- (NSString * _Nullable)formFieldGroupName {
return [self.json string:@"groupName"];
}
- (NSString *)accessibilityHint {
return [MVMCoreUIUtility hardcodedStringWithKey:@"AccToggleHint"];
}

View File

@ -39,7 +39,7 @@
@"textField" : MFTextField.class,
@"digitTextField" : MFDigitTextField.class,
@"checkbox" : Checkbox.class,
@"checkboxWithLabelView" : CheckboxWithLabelView.class,
@"checkboxWithLabel" : CheckboxWithLabelView.class,
@"cornerLabels" : CornerLabels.class,
@"progressbar": ProgressBar.class,
@"circleProgress": GraphView.class,