myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Yee" <>
Subject [Trinidad] Executing a JavaScript function when a validation error occurs
Date Fri, 25 Jan 2008 23:00:04 GMT
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


<tr:commandButton text="Continue" action="#{myBacking.continueAction}"
<tr:outputText id="loadProgress" inlineStyle="text-align:centered;
background-color: red; display: none;" value="Loading..."/>

function showProgress() {
  var progressElem = document.getElementById("loadProgress"); = 'inline';

function clearProgress() {
  var progressElem = document.getElementById("loadProgress"); = 'none';

View raw message