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