I am using Seam to develop portlets on Jboss Portal Platform. I had a question about handling AJAX errors in Seam. I used the following code to handle exceptions in AJAX calls:
xhtml :
<script type="text/javascript">
A4J.AJAX.onError = function(req,status,message){
alert("error occured " + message);
};
</script>
<h:form id="loadPanelForm" >
<a4j:commandLink value="Edit" action="#{myLinksAction.loadMyLinksForEdit}" reRender="myLinksEditForm" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('myLinksEditPanel')}.show();"/>
</h:form>Function:
public void loadMyLinksForEdit() {
throw new IllegalStateException("Exception while trying to load links");
}
However, I do not see the alert message when an exception occurs.
Can you please help me with this?