We have an a4j:outputPanel
that is ajaxRendered
. Is there a way to call a javascript function each time it is (re)rendered? I know that we could put a call in every element that could possibly submit with oncomplete
, but that really isn't practicably maintainable.
Details:
- JSF 1.2
- Richfaces 3.3
Example (oncomplete isn't actually available on the outputPanel tag):
<a4j:outputPanel ajaxRendered="true" oncomplete="myJSFunc()">
<h:outputText value="Test-aroo" />
</a4j:outputPanel>
<!-- other inputs, buttons and stuff -->
Update Might the jQuery library be able to help (it's built into RichFaces)? I'm looking at using .live() to maybe register with the oncomplete event. I'll keep experimenting and update with progress.
Update I didn't get a chance to implement the jQuery solution, but as my answer shows below myJSFunc()
can just be put directly inside the rendered tags.