Field Level Notification
Field level notifications are mostly used for displaying an error message for the field/control to indicate that data isn't valid.
If you want to give field level notification using javaScript then you can use following syntax:
Syntax :
formContext.getControl(arg).setNotification(message, uniqueId);
message - to display message.
uniqueId - to clear the message
Following is the example of use of field-level notification :
FormLevelNotification: function(executionContext) {
var formContext = executionContext.getFormContext();
var age = formContext.getAttribute("age").getValue();
if(age != null && age.getValue() < 18) {
//set otification to field
formContext.getControl("age").setNotification("Age should be greater than 18", "200") //200 is uniqueId
formContext.getAttribute("age").setValue(null);
}
else {
//clear notification from field
formContext.getControl("age").clearNotification("200");
}
}
Comments
Post a Comment