2 Replies Latest reply on May 31, 2007 8:42 AM by Thai Dang Vu

    Howto navigate to a non-template-based xhmtl page from a tem

    Thai Dang Vu Apprentice

      Hello everybody,

      I use facelets to create a xhtml template, then page1.xhtml uses that template. In page1.xhtml page, I use a4j:include to include page1_1.xhtml which has a <h:form ...> ... </h:form>. From page1.xhtml I want to navigate to a non-template-based page2.xhtml page using <h:commandLink>. So in the faces-config.xml file I have something like:

      <navigation-rule>
       <from-view-id>/page1_1.xhtml</from-view-id>
       <navigation-case>
       <from-outcome>to-page2</from-outcome>
       <to-view-id>/page2.xhtml</to-view-id>
       </navigation-case>
       </navigation-rule>

      Then what I see has the template that page1.xhtml uses. How can I get rid of that template?

      Thanks for any of your suggestion.

      PS: I need a solution very urgently.

        • 1. Re: Howto navigate to a non-template-based xhmtl page from a
          Ilya Shaikovsky Master

          So.. I missed the points.. what wrong with your scenario? and what the problems while using common h:command??

          • 2. Re: Howto navigate to a non-template-based xhmtl page from a
            Thai Dang Vu Apprentice

            Let me clarify it.I use RichFaces tabpanel and tab. In one of the tabs, I use <a4j:include viewId="/pieces/page1_1.xhtml" /> I also have page1_2.xhtml, page1_3.xhtml which are steps in a wizard (like the example of a4j:include http://livedemo.exadel.com/a4j-include/). So my faces-config.xml is like this:

            <navigation-rule>
             <from-view-id>/pieces/page1_1.xhtml</from-view-id>
             <navigation-case>
             <from-outcome>next</from-outcome>
             <to-view-id>/pieces/page1_2.xhtml</to-view-id>
             </navigation-case>
            </navigation-rule>
            
            <navigation-rule>
             <from-view-id>/pieces/page1_2.xhtml</from-view-id>
             <navigation-case>
             <from-outcome>back</from-outcome>
             <to-view-id>/pieces/page1_1.xhtml</to-view-id>
             </navigation-case>
             <navigation-case>
             <from-outcome>next</from-outcome>
             <to-view-id>/pieces/page1_3.xhtml</to-view-id>
             </navigation-case>
            </navigation-rule>
            
            <navigation-rule>
             <from-view-id>/pieces/page1_3.xhtml</from-view-id>
             <navigation-case>
             <from-outcome>back</from-outcome>
             <to-view-id>/pieces/page1_2.xhtml</to-view-id>
             </navigation-case>
            </navigation-rule>
            In page1_2.xhtml, I need to provide a link with the target=_blank so that when this link is clicked a new window open and that new window doesn't have the tabpanel and tab (that's what I don't know how to do). So the faces-config.xml will look like:
            <navigation-rule>
             <from-view-id>/pieces/page1_1.xhtml</from-view-id>
             <navigation-case>
             <from-outcome>next</from-outcome>
             <to-view-id>/pieces/page1_2.xhtml</to-view-id>
             </navigation-case>
            </navigation-rule>
            
            <navigation-rule>
             <from-view-id>/pieces/page1_2.xhtml</from-view-id>
             <navigation-case>
             <from-outcome>back</from-outcome>
             <to-view-id>/pieces/page1_1.xhtml</to-view-id>
             </navigation-case>
             <navigation-case>
             <from-outcome>next</from-outcome>
             <to-view-id>/pieces/page1_3.xhtml</to-view-id>
             </navigation-case>
            
             <navigation-case>
             <from-outcome>special link</from-outcome>
             <to-view-id>/page2.xhtml</to-view-id>
             </navigation-case>
            
            </navigation-rule>
            
            <navigation-rule>
             <from-view-id>/pieces/page1_3.xhtml</from-view-id>
             <navigation-case>
             <from-outcome>back</from-outcome>
             <to-view-id>/pieces/page1_2.xhtml</to-view-id>
             </navigation-case>
            </navigation-rule>


            How can I do that?