Wednesday, 15 February 2017

Salesforce Lightning How to display error message just below the UI markup component


Below code displays error message just below the UI markup component such as text box, select list etc.


            var Error = $A.get("$Label.c.Comments_Required_Error");

            component.find("comments").set("v.errors",[{message:Error}]);


Below code snippet can be used in controller.js or helper.js to display the error message just below the component.

In the above component.find("comments") will help identify the markup component. set("v.errors",[{message:cmtError}]) is used to set the error message.



No comments:

Post a Comment