/* * Responsible method for capturing and showing error message via DWR */ function showErrorMessage(message, messageId) { ManageAllMessagesDWR.getMessage(message, messageId, setErrorMessageDWR ); } /* * Responsible method for adjusting the message of error in the page */ function setErrorMessageDWR(data) { DWRUtil.setValue("errorMessageDWR",data); //alert('Erro:' + data); formatErrorMessageDWR(data); displayMessageErrorDWR(); } /* * Responsible method for showing the element in the page that shows the message of occured error in call DWR. */ function displayMessageErrorDWR(){ document.getElementById("errorMessageDWR").style.display=""; document.getElementById("viewMessagesPortal").innerHTML=""; } /* * Responsible method for occulting the element in the page that shows the message of occured error in call DWR. * This method always will have to be called before a solicitation AJAX to archive DWR */ function hideMessageErrorDWR(){ document.getElementById("errorMessageDWR").style.display="none"; } function formatErrorMessageDWR(data) { document.getElementById("errorMessageDWR").innerHtml=""; } /* * It evaluates result of the validation via DWR */ function evaluateResult(msg) { if (msg != null) { // parameters: message code and message for jsp field id, null if not require parameters setErrorMessageDWR(msg); } else { document.forms[0].submit(); } }