4 Replies Latest reply on Apr 20, 2011 6:29 AM by hantsy

    Page action in ViewConfig

    gonzalad

      Hello,


      Just noticed ViewConfig documentation http://docs.jboss.org/seam/3/faces/latest/reference/en-US/html/viewconfig.html.


      Nice feature (old pages.xml) !


      Can I configure a page action with ViewConfig ?


      For instance :


      @ViewConfig
      public interface Pages {
          static enum Pages1 {
      
              @ViewPattern("/*")
              @ViewAction("#{bean.doSomething()}")
              ALL;
          }
      
      }
      



      Thanks !

        • 1. Re: Page action in ViewConfig
          bleathem

          That's a great idea, and I don't think it would involve too much to implement it.


          Would you mind filing a jira issue asking for the feature?


          Brian Leathem

          • 2. Re: Page action in ViewConfig
            lightguard

            Brian, you may already know this, if you do, please disregard.


            PrettyFaces has this capability, and the added bonus of specifying which phase you want this to occur, they also have annotations for it (you annotate the method you want invoked). I'm sure we could create a mapping for it from the enum to the PrettyFaces solution if users want it all to be in one area.

            • 3. Re: Page action in ViewConfig
              gonzalad

              Thanks very much, created SEAMFACES-147


              With this annotation, it will be easier for us to migrate to Seam 3 (we use a lot of page action in pages.xml ;) - even for wildcard pages).

              • 4. Re: Page action in ViewConfig
                hantsy

                These codes seems a little uncomfortable...the interfaces Pages and enum Pages1 are meaningless here.
                1. I think it is better to introduce xml config like seam2.
                2. Provides a programatic approach to build the url pattern by code.
                Such as



                public void viewConfig(@Observes @SOMEJSFPhase ViewConfiguration config){
                    config.add(new ViewConfigBuilder().url("/")....build());
                
                }