Icefaces has a javascript library that can queue events on client side. Icefaces refreshes DOM after the completion of action so you can queue an event at the end of your action method.
This is something I have used with Icefaces 1.8.x and 2.0 . I am not very sure if Icefaces 3 has any special component/code added to capture the DOM update events.
xhtml
<script>
function toggleDisplay(id,style)
{
document.getElementById(id).style.display = style;
}
</script>
<div id="msgDiv" style="display:none">Processing ..</div>
<h:commandButton action="#{mybean.doUpdate}"
onclick="toggleDisplay('msgDiv','visible')"/>
Your Managed Bean
public class MyBean{
....
doUpdate(ActionEvent e){
//do stuff
JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(),
"toggleDisplay('msgDiv','none');")
}
}
You can also do it very easily by using f:ajax on h:commandButton and re-rendering your message during ajax call .
http://www.mkyong.com/jsf2/jsf-2-0-ajax-hello-world-example/
<h:commandButton>
only. You will need<f:ajax>
or some IceFaces commandButton component in order to achieve this. You can find lots of tutorials about JSf<f:ajax>
on the net. – Luiggi Mendoza