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 7405809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:27:39+00:00 2026-05-29T05:27:39+00:00

I have created facelet template: left-right.xhtml <ui:composition> <ui:include name=left /> <hr /> <ui:include name=right

  • 0

I have created facelet template:

left-right.xhtml

<ui:composition>
    <ui:include name="left" />
    <hr />
    <ui:include name="right" />
</ui:composition>

After, if I use this template with ui:decorate it works fine:

index.xhtml

<ui:decorate template="left-right.xhtml">
    <ui:define name="left">FOO</ui:define>
    <ui:define name="right">BAR</ui:define>
</ui:decorate>

BUT, if I use this template as custom facelet tag it does not works.

custom-taglib.xml

<facelet-taglib>
    <tag>
        <tag-name>leftright</tag-name>
        <source>left-right.xhtml</source>
    </tag>
</facelet-taglib>

index.xhtml

<custom:leftright>
    <ui:define name="left">FOO</ui:define>
    <ui:define name="right">BAR</ui:define>
</custom:leftright>

The content inside ui:define tags is not included into template 🙁

So, question is how can I parameterise facelet template if it renders as facelet custom tag?

  • 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-05-29T05:27:39+00:00Added an answer on May 29, 2026 at 5:27 am

    (note that you have a syntax error in your left-right.xhtml, you should be using <ui:insert> instead of <ui:include>, but I’ll assume it to be just careless oversimplification)

    A tag file cannot be treated as a template client. You need to approach it differently depending on the concrete functional requirement. If you’re on JSF 2.x, then a composite component would be the closest which you need. You could define the parts as <f:facet> and render them by <cc:renderFacet> in the composite implementation.

    E.g.

    /resources/custom/leftRight.xhtml

    <cc:interface>
        <cc:facet name="left" required="true" />
        <cc:facet name="right" required="true" />
    </cc:interface>
    <cc:implementation>
        <cc:renderFacet name="left" />
        <hr />
        <cc:renderFacet name="right" />
    </cc:implementation>
    

    Usage:

    <custom:leftRight>
        <f:facet name="left">FOO</f:facet>
        <f:facet name="right">FOO</f:facet>
    </custom:leftRight>
    

    But if you’re still on JSF 1.x, you cannot create a composite component. You’d need to stick to <ui:decorate>.

    See also:

    • When to use <ui:include>, tag files, composite components and/or custom components?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a template for Visual Studio 2008 and it currently shows up
I have a pretty complex JSF page (we use JSF2 with facelet) in which
I have jsf application in which I have to use a facelet custom component
I have two facelet-pages: customers.xhtml (with a list of customers) and customer.xhtml for detail-view
I have a CKEditor in my page. Like this <h:head> <title>Facelet Title</title> <script type=text/javascript
I have created my first asp.net UserControl that I will use in several places
I have created a facebook apps. Works fine for me. It contains canvas url,
I have created a facebook apps. It works fine for me. But my problem
I created template (template.xhtml) which resides in root context of application. I wanted to
I have created a number of tool tips in JavaScript for use in a

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.