customMandatoryCheck method
bool
customMandatoryCheck(
- dynamic componentList
)
Implementation
bool customMandatoryCheck(var componentList) {
for (var comp in flattenHtmlComponents(componentList)) {
if (comp["security"] != null &&
(comp["security"]["required"] != null &&
comp["security"]["required"]) &&
comp["controlType"] == "EXCEL") {
if (comp["dataFileName"] == null) {
return true;
}
}
if ((comp["security"] != null) &&
(comp["security"]["required"] != null &&
comp["security"]["required"]) &&
comp["controlType"] == "ATTACHMENTS") {
if (comp["files"] == null || comp["files"].length == 0) {
return true;
}
}
if ((comp["security"] != null) &&
(comp["security"]["required"] != null &&
comp["security"]["required"] == true) &&
comp["controlType"] == "DROPDOWN") {
if (comp["value"] == null || comp["value"] == "") {
return true;
}
}
if ((comp["security"] != null) &&
(comp["security"]["required"] != null &&
comp["security"]["required"]) &&
comp["controlType"] == "TEXTFIELD") {
if (comp["value"] == null || comp["value"] == "") {
return true;
}
}
if ((comp["security"] != null) &&
(comp["security"]["required"] != null &&
comp["security"]["required"]) &&
comp["controlType"] == "LABEL") {
if (comp["value"] == null) {
return true;
}
}
}
return false;
}