sending model json
This commit is contained in:
parent
cdbd344319
commit
4254e63993
@ -24,6 +24,10 @@ import MVMCore
|
||||
var groupName: String?
|
||||
var delegateObject: MVMCoreUIDelegateObject?
|
||||
|
||||
public var checkboxModel: CheckboxModel? {
|
||||
return model as? CheckboxModel
|
||||
}
|
||||
|
||||
public static let defaultHeightWidth: CGFloat = 18.0
|
||||
|
||||
/// If true the border of this checkbox will be circular.
|
||||
@ -393,7 +397,7 @@ import MVMCore
|
||||
|
||||
private func performCheckboxAction(with actionModel: ActionModelProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
if let actionMap = actionModel.toJSON() {
|
||||
MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: additionalData, delegateObject: delegateObject)
|
||||
MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: checkboxModel?.toJSON(), delegateObject: delegateObject)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ open class RadioBox: Control, MFButtonProtocol {
|
||||
isSelected = true
|
||||
radioBoxModel?.selected = isSelected
|
||||
if let actionModel = radioBoxModel?.action {
|
||||
Button.performButtonAction(with: actionModel, button: self, delegateObject: delegateObject, additionalData: nil)
|
||||
Button.performButtonAction(with: actionModel, button: self, delegateObject: delegateObject, additionalData: radioBoxModel?.toJSON())
|
||||
}
|
||||
layer.setNeedsDisplay()
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ import UIKit
|
||||
isSelected = !isSelected
|
||||
}
|
||||
if let actionModel = radioModel?.action, isSelected {
|
||||
Button.performButtonAction(with: actionModel, button: self, delegateObject: delegateObject, additionalData: nil)
|
||||
Button.performButtonAction(with: actionModel, button: self, delegateObject: delegateObject, additionalData: radioModel?.toJSON())
|
||||
}
|
||||
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
|
||||
setNeedsDisplay()
|
||||
|
||||
@ -121,7 +121,7 @@ open class RadioSwatch: Control, MFButtonProtocol {
|
||||
isSelected = true
|
||||
radioSwatchModel?.selected = isSelected
|
||||
if let actionModel = radioSwatchModel?.action {
|
||||
Button.performButtonAction(with: actionModel, button: self, delegateObject: delegateObject, additionalData: nil)
|
||||
Button.performButtonAction(with: actionModel, button: self, delegateObject: delegateObject, additionalData: radioSwatchModel?.toJSON())
|
||||
}
|
||||
layer.setNeedsDisplay()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user