Adding Errors with JS

skuid.page.addProblem() is meant for Skuid Page level errors, like major runtime errors that can be corrected by going to the Page Builder. The kind of messages displayed when you have missing required fields, or when there’s a save problem, are always dealt with at the skuid.ui.Editor level. Editors have a messages property storing their messages. There is an API method on Editor called “handleMessages” that lets you tell Editors to display messages, and you can pass in various Severities of message: - (no severity specified): message displays in blue - ‘WARNING’: displays in yellow - ‘ERROR’ / ‘FATAL’: displays in red Duplicates are not displayed twice — rather, a number is displayed to the right indicating how many of this message the editor now has. All types of messages can be removed by the user simply by clicking on them. Here is an example:

var $ = skuid.$; var pageTitle = $('#MyPageTitle'); var editor = pageTitle.data('object').editor; editor.handleMessages( [ { message: 'This is a regular message, should be in blue' }, // Since this is a duplicate, it should not be displayed twice { message: 'This is a regular message, should be in blue' }, { message: 'This is a Warning message, should be in yellow', severity: 'WARNING' }, { message: 'This is a Error/Fatal message, should be in red', severity: 'ERROR' } ] ); 

which produces this: