0 Replies Latest reply on Aug 22, 2011 2:55 PM by Janani Venkatesan

    Exception handling in AJAX

    Janani Venkatesan Newbie

      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);
      <h:form id="loadPanelForm" > 
        <a4j:commandLink value="Edit" action="#{myLinksAction.loadMyLinksForEdit}" reRender="myLinksEditForm" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('myLinksEditPanel')}.show();"/>


      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?