Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8671573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:58:58+00:00 2026-06-12T18:58:58+00:00

I have a bro problem which I don’t know how to solve. I have

  • 0

I have a bro problem which I don’t know how to solve. I have this Primefaces p:tabMenu which is used to call tabs with lazy loading.

<p:tabMenu id="tabs" activeIndex="0" > 
    <p:menuitem value="tab1" url="/tab1.jsf" /> 
    <p:menuitem value="tab2" url="/tab2.jsf" /> 

</p:tabMenu>

I want to use the JSF tag ui:insert in order to call the tab’s code. How I can combine the ui:insert tag into the above code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:58:59+00:00Added an answer on June 12, 2026 at 6:58 pm

    I see 2 approaches here:

    1) Use one page for each tab. use the p:tabMenu component (available in primefaces 3.4). In this case, if user is viewing one tab and clicks on the second tab to display it, he will be redirected to another page.
    pros: if you want to navigate from another page to the second tab, it’s easy since it’s a different page (see cons in 2nd approach). also, each tab page is load fast because it only contains code for one tab. you’ll have a better separation of code.
    cons: if users goes to another tab, all data entered in current tab will be lost. also, changing from one tab to another is not so fast because there is navigation involved.

    this is the page for one tab (tab1.xhtml):

    <h:body>
        <p:tabMenu activeIndex="0">  
            <p:menuitem value="Tab 1" url="/tab1.jsf" />  
            <p:menuitem value="Tab 2" url="/tab2.jsf" />  
        </p:tabMenu>
        <!-- content of tab1 goes here -->
    </h:body>  
    

    this is the code for the other tab (tab2.xhtml):

    <h:body>
        <p:tabMenu activeIndex="1">  
            <p:menuitem value="Tab 1" url="/tab1.jsf" />  
            <p:menuitem value="Tab 2" url="/tab2.jsf" />  
        </p:tabMenu>
        <!-- content of tab2 goes here -->
    </h:body>
    

    2) The other approach is to have one page with p:tabView. in this case, all the tab contents go in the same page. you can use dynamic=”true” attribute on p:tabView to render the tab contents on demand and accelerate page load.
    pros: smoother transition from tab to tab (always stays on same page).
    cons: if you want to navigate directly to the 2nd tab for example, it’s not so easy. so will have to use activeIndex attribute of tabView pointing to an attribute in the managed bean that handles the first tab, and still you’ll be constructing the bean of the first tab when you actually don’t need it.

    this is the code for the main page that contains the tab:

    <h:body>
        <p:tabView dynamic="true">
            <p:tab id="tab1" title="Tab 1" >
                <ui:include src="tab2.xhtml" />
            </p:tabView>
            <p:tab id="tab2" title="Tab 2" >
                <ui:include src="tab2.xhtml" />
            </p:tab>
        </p:tabView>
    </h:body>
    

    and you’ll need the pages for each tab (that is inserted into main page):
    tab1.xhtml:

    tab2.xhtml:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have written this little class, which generates a UUID every time an object of
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
have a nice day. I got problem when trying to create an image from
I have json data like this: { Adobe Photoshop: 70, Adobe Premier: 71, Animasyon:
have tables like this Table checklist idCardno name permAddress datetime Table persons name idcardno
I have this: mylink -> myfile When I do: find -L . -name 'mylink'
I have a JavaScript object that does something like this - using a closure
Apologies is this is something a more seasoned R user would know, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.