2 Replies Latest reply on Sep 28, 2007 7:16 AM by Pete Muir

    FacesMessage not showing up

    stephen.friedrich Novice

      By default EntityHome throws an exception if an entity cannot be found.
      (For example when somebody else already deleted an entity and you want to edit it.)

      I managed to get rid of that exception by overriding handleNotFound in my EntityHomes:

      protected T handleNotFound() {
       setId(null);
       T instance = createInstance();
       setInstance(instance);
      
       getFacesMessages().add( SEVERITY_INFO, "Object has already been deleted.");
       return instance;
      }
      


      The only problem is that the message never makes it to the result page (same as originating page). No errors in the log. No nothing.

      The edit that caused the call to handleNotFound is triggered like this:
      <s:link view="/departments.xhtml">
       <f:param name="departmentId" value="#{department.id}"/>
       <img src="images/edit.gif" alt="#{department.id}" border="0"/>
      </s:link>
      


      The default messages (like "Successfully updated") _are_ shown.

      What am I doing wrong? (Seam 1.2.1)