I am not able to call a4j:commandButton click on window unload. my jsf code is here
a4j:commandButton
1st the javascript in which i have window unload method
javascript
It's much cleaner to use jsFunction for this:
jsFunction
<script type="text/javascript"> window.onbeforeunload = function() { closeTime(); } </script> <h:form id="pForm"> <a4j:jsFunction name="closeTime" action="#{controller.update}" oncomplete="window.close()"/> </h:form>