We were facing the same issue under IceFaces 1.8.2. The problem is that the server side application does not know about your client side changes to the DOM. We solved it for us by applying marker classes to the elements we wanted to manipulate with jQuery. We used the generic client side callback for DOM-Updates (onAsynchronousReceive
under IceFaces 1.8.x) to reapply our script.
Unfortunately not RichFaces specific:
<h:outputText value="my text" styleClass="doSomethingWithThisAfterDOMUpdate" />
And somewhere in your page markup (we are using jQuery bound to j instead of $):
<script type="text/javascript">
// do somehting the first time
j(".doSomethingWithThisAfterDOMUpdate").css('display', 'none');
Ice.onAsynchronousReceive("document:body", function() {
// do it again after each asynchronous receive
j(".doSomethingWithThisAfterDOMUpdate").css('display', 'none');
});
</script>
BUT: Be careful applying listeners to elements in the callback. If the element does not get replaced, you assign the same listeners a second, third, fourth time...
Under JSF2 AJAX became part of the spec. You might have a look at the client side method addOnEvent which could be the generic counter part of Ice.onAsynchronousReceive.
However, not all component frameworks seem to use the client side implementation of the spec to perform their DOM updates (i.e. PrimeFaces).
But I guess the principle becomes clear. You need to rerun the script after the DOM Element got replaced :)