4 Replies Latest reply on May 24, 2011 3:53 AM by Its Me

    Error Handling in Richfaces- rich:messages- Error not being displayed.

    Its Me Newbie

      Hello Everyone,


      I have the following code in my xhtml file:

      <h:form id="searchForm">
                      <a4j:outputPanel ajaxRendered="true">
                          <rich:modalPanel id="errModPanel" showWhenRendered="#{not (facesContext.maximumSeverity==null)}">
                              <f:facet name="controls">
                                      <img src="#{facesContext.externalContext.requestContextPath}/images/close_icon.gif"  id="errhidelink"/>

                                      <rich:componentControl for="errModPanel" attachTo="errhidelink" operation="hide" event="onclick"/>
                              <h:panelGrid columns="2" width="100%"
                                           style="margin:0px; padding:0px; border:5px">
                                  <h:outputText value="Error" />       



                              <a4j:commandButton value="OK" styleClass="dialog_button"
                                                 onclick="Richfaces.hideModalPanel('errModPanel'); return false;">






      I have the following code in the bean:



      } catch (Exception e) {
                  FacesContext fc = FacesContext.getCurrentInstance();
                  HttpServletRequest request = (HttpServletRequest) fc.getExternalContext().getRequest();
                  request.setAttribute("apiException", "true");

                          new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(),
                  LOGGER.error("Exception occured =" + e);


      When I get the exception, I can see it in the logs. The modal panel opens up.... but doesnt show any errors. Am I missing any setting? Any help is appreciated.


      Thanks in advance.