Hi,
I'm displaying a "Loading..." message to my user after they press a
commandButton by having an onclick event fire a JavaScript function. This
works fine except for when there is a validation error. In this case, the
"Loading..." message is still displayed. What I would like to have happen is
to hide the Loading message when this occurs. I tried setting the onload
event in the tr:document tag to clearProgress() but it didn't get called. Is
there another way to execute a JavaScript function when a validation error
occurs?
Thanks,
Richard
.jspx
....
<tr:commandButton text="Continue" action="#{myBacking.continueAction}"
onclick="showProgress()"/>
<tr:outputText id="loadProgress" inlineStyle="text-align:centered;
background-color: red; display: none;" value="Loading..."/>
....
JavaScript:
function showProgress() {
var progressElem = document.getElementById("loadProgress");
progressElem.style.display = 'inline';
}
function clearProgress() {
var progressElem = document.getElementById("loadProgress");
progressElem.style.display = 'none';
}