// Add the ERROR class to the sourrounding component
b.append("$('#" + getComponent().getMarkupId() + "').parent().addClass('" + ERROR_COMPONENT_CLASS + "');");
// Create list of error messages, separated by the chosen separator markup
List<FeedbackMessage> messages = Session.get().getFeedbackMessages().messages(new ComponentFeedbackMessageFilter(getComponent()));
StringBuilder mb = new StringBuilder("");
for(int i = 0; i < messages.size(); i++ ) {
String msg = messages.get(i).getMessage().toString().replace("'", "\\'");
mb.append(msg);