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

    FacesMessage not showing up

    stephen.friedrich

      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)

        • 1. Re: FacesMessage not showing up
          stephen.friedrich

          Anybody?
          I guess this comes from the fact that the find() method is called when dependency injection occurs and not inside an action handler.
          I've had no luck working around this problem yet.

          • 2. Re: FacesMessage not showing up
            pmuir

            it should still work afaics. Are you inside an long running conversation?

            There is some strange handling with faces messages to work around serializability, but use your debugger inside FacesMessages to find out where they get lost. If you are still stuck provide a patch against an example to reproduce and hopefully someone can take a look for you.