We are using the following code for adding new error messages while validating the document:
function addFacesMessage( message, component ){
try {
if( typeof component === 'string' ){
component = getComponent( component );
}
var clientId = null;
if( component ){
clientId = component.getClientId( facesContext );
}
facesContext.addMessage( clientId, new javax.faces.application.FacesMessage( message ) );
} catch(e){
globalScriptErrors.add(e);
requestScope.put("scriptErrors", globalScriptErrors);
}
}
We call this function in every validation routine, if an error occured:
facesContext.addMessage("",
new javax.faces.application.FacesMessage("errormessage" );
In our XPage we've got an error message box to show all errors, that have occured for the current page:
<xp:messages id="messages2" styleClass="lotusMessage lotusWarning"></xp:messages>
Now, messages are displayed in the error message box, but how can we check if there are errors for this page? We want to use this information e.g. for an popup, that only has to be displayed, if no errors are displayed in the error message box. But how do we get this information?