0 Replies Latest reply on Aug 12, 2010 7:38 AM by Uwe Rasmus

    Usage of @RequestParameter results in handling transient entity

    Uwe Rasmus Newbie

      If I want to remove entity from list (I'm using EntityQuery) with this code:

      <s:link value="Delete it" action="#{attachmentHome.remove()}">
            <f:param name="attachmentId" value="#{myObject.id}"/>

      and I specify this in the home component:

      public class AttachmentHome extends EntityHome<Attachment> {
          private Long attachmentId;

      then the code for removing from db doesn't work. It just says in the log file that:

      INFO  [DefaultDeleteEventListener] handling transient entity in delete processing

      I have found solution on this forum to use pages.xml instead of @RequestParameter as that:

      <page view-id="/attachmentList.xhtml">    
          <param name="attachmentId" value="#{attachmentHome.id}" converterId="javax.faces.Long" />

      It works. I just don't understand why and because we have already many @RequestParams, it will be very hard way to convert it to pages.xml parameters. Shouldn't be the meaning of RequestParam and pageparam in pages.xml the same?? Is there other way to correct usage of @RequestParam?

      For the sake of completeness this is the thread, where I found answer.

      Thanks a lot for help,