4 Replies Latest reply on Feb 28, 2007 6:43 PM by Gavin King

    pages.xml issues after upgrade to seam 1.2

    Jonas Erma Newbie

      Hi all!

      I upgraded today to Seam 1.2 and many functionalities of pages.xml have stopped working since then. Namely, page parameters and login redirection don't work anymore.

      I have an ArticleHome like this:

      @Name("articleHome")
      public class ArticleHome extends EntityHome<Article> {
       @In(create = true)
       EntityManager entityManager;
      
       @In(required = false)
       Integer articleId;
      
       @Factory("article")
       public Article initArticle() { return getInstance(); }
      
       public Object getId() {
       return articleId;
       }
      
       @Override
       public EntityManager getEntityManager() {
       return entityManager;
       }
       ...
      
      }
      
      


      And I have this in pages.xml for the articleId param:

       <page view-id="/article.seam">
       <param name="id" value="#{articleHome.articleId}" />
       </page>
      


      The articleId is always null when the factory method is invoked. However, a query that returns comments for the article gets somehow the article's id. So in the article.seam page, I can see the article's comments but an empty article:


       <framework:entity-query name="commentsQuery" ejbql="select c from Comment c" max-results="10">
       <framework:restrictions>
       <value>article_id = #{article.id}</value>
       </framework:restrictions>
       </framework:entity-query>
      


      When I try to paginate through the comments, I always get the first page back because firstResult page parameter is not set either.

      If I use @RequestParameter(value="id") Integer articleId instead of page parameter, everything work but pagination.


      My other problem is that login redirection doesn't work anymore.

      All of these were working yesterday with Seam CVS version from Feb 26th. When I downgrade back to that version, they start working again. I cannot figure out what the issue is. I checked the seam examples and adapted my config files to 1.2 schemas.

      I'm using JSF 1.2 RI, Ajax4JSF 1.0.5, and Facelets 1.1.11 on top of JBoss 4.0.5.

      Does somebody have any idea?

      tazman