2 Replies Latest reply on Feb 20, 2008 4:32 AM by Fred Bricon

    Page navigation with Seam

    Fred Bricon Newbie

      Hi,

      I'm developping an application using Facelets + Seam 2.0.1GA + RF 3.1.4.GA.

      We have tabs defined in a template

      <rich:tabPanel selectedTab="#{navigation.selectedTab}">
       <rich:tab label="tab1" name="subpage1">
       <ui:insert name="subpage1"/>
       </rich:tab>
       <rich:tab label="tab2" name="subpage2">
       <ui:insert name="subpage2"/>
       </rich:tab>
       ...
      <rich:tabPanel>
      


      Each subpage extends that template and defines its element subpage#.

      Is there a way to get direct links to the pages on the tabs, without having to implement an action rendering the view name?
      i.e. instead of writing
      action="#{controller.goToSubPage2()}"
      

      I'd prefer something like
      action="subpage2"
      or
      action="subpage2.seam"
      or
      action="subpage2.xhtml"
      


      In fact the same thing applies when using <rich:panelMenuItem>

      Regards

      Fred B.


        • 1. Re: Page navigation with Seam
          Ilya Shaikovsky Master

          You mean that your action changes the current tab to another using selectedTab="#{navigation.selectedTab}" property change?
          In this case you should develop the methods for sure.

          • 2. Re: Page navigation with Seam
            Fred Bricon Newbie

            I've found a satisfying solution :

            <rich:tabPanel selectedTab="#{navigation.selectedTab}">
             <rich:tab label="tab1" name="subpage1" action="/subpage1">
             <ui:insert name="subpage1"/>
             </rich:tab>
             <rich:tab label="tab2" name="subpage2" action="/subpage2">
             <ui:insert name="subpage2"/>
             </rich:tab>
             ...
            <rich:tabPanel>
            


            and in seam's pages.xml I added for each view :

            <action execute="#{navigation.setSelectedTab('subpage2')}"/>