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

  • Home
  • SEARCH
  • 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 8775265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:45:43+00:00 2026-06-13T18:45:43+00:00

I am creating a simple web application to try out JSF2 with PrimeFaces, so

  • 0

I am creating a simple web application to try out JSF2 with PrimeFaces, so far really impressed by how much it can do out of the box. Going through various tutorials and articles I have a question about properties in templates and whether it is possible to insert these.

I know I can insert chunks of HTML content in templates, for example:

<title>
  <ui:insert name="title">Default Title</ui:insert>
</title>

But in some cases it would be useful to insert at property level. The specific one I thought of was TabMenu, where if you were using a TabMenu for navigation (and you want the same TabMenu on every page so it makes sense to use a template), you would want to set the ‘activeIndex’ differently depending on which page you were looking at. This however does not seem to work in a template file:

<p:tabMenu <ui:insert name="activeIndex">activeIndex="0"</ui:insert>>
  <p:menuitem value="Overview" outcome="main" icon="ui-icon-star"/>
  <p:menuitem value="Demos" outcome="demos" icon="ui-icon-search" />
  <p:menuitem value="Documentation" outcome="docs" icon="ui-icon-document"/>
</p:tabMenu>

Hope that makes sense. Is there a way to do this, or is this design just completely wrong and there is a much better way of doing it?

  • 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-13T18:45:44+00:00Added an answer on June 13, 2026 at 6:45 pm

    Pass it as <ui:param>.

    E.g. in template client:

    <ui:composition template="/WEB-INF/templates/some.xhtml">
        <ui:param name="activeIndex" value="0" />
    
        ...
    </ui:composition>
    

    and in master template:

    <p:tabMenu activeIndex="#{activeIndex}">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a simple pastebin web application on top of Symfony2, but I can't
I am interested in creating a simple web application that will take in user
I'm following this example for creating a simple Web application using JAX-RS, MongoDB and
i'm creating a very simple (hello World quality) web application using spring mvc 3.0.
I am creating a simple web application. I need to get reference to ServletContext
I'm creating a simple web application with which a user may author a message
I am creating simple blog web application using play framework and i want to
I am creating a simple blog web application using play framework, where there are
I'm creating a very simple chat application. It has an ASP.NET web page as
Possible Duplicate: Bottle-friendly WSGI authentication library/middleware I'm creating a simple web application with Python

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.