I try to control primefaces display show and hide from java script on bean validation failure, but its not working. As suggested in forums have tried with widgetVar name of the component in javascript and even tried with id of the component but failed.
XHTML
<p:dialog header="Modal Dialog" id="mglasspaneid" showHeader="false" closable="true" resizable="false" draggable="false" widgetVar="mglasspane" style="height: 50px !important;" modal="true">
<span id="loading" draggable="false" style="height: auto !important;">Loading</span>
</p:dialog>
Javascript
<script>
function handleComplete(data) {
if (data.status === 'success') {
console.log(document.getElementById('validation-failed').value);
mglasspane.hide();
}else{
console.log(document.getElementById('validation-failed').value);
mglasspane.show();
}
}
</script>