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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:28:30+00:00 2026-05-19T00:28:30+00:00

I created a JSF composite component to extend h:inputBox <p class=label clear> <label for=#{cc.attrs.id}

  • 0

I created a JSF composite component to extend h:inputBox

        <p class="label clear">
            <label for="#{cc.attrs.id}" class="">
                #{cc.attrs.label}:
            </label>
        </p>
        <p>
            <h:inputText id="#{cc.attrs.id}" value="#{cc.attrs.value}" 
                size="#{cc.attrs.size}" />
            <ui:fragment rendered="#{cc.attrs.optional eq 'optional'}">
                <span class="optional">Optional</span>
            </ui:fragment>
        </p>

To use this component..

<my:inputText id="firstName" label="First Name" value="#{nameTO.firstName}"/>

When this component is rendered on the browser, the ID is of the format “firstName:firstName”.

<input type="text" value="" name="firstName:firstName" id="firstName:firstName" gtbfieldid="3028">

Is this a standard naming convention with JSF 2.0 templates? I did not get this with JSF 1.2 Facelets templates.
Is there any way to generate the ID as just “firstName” instead of “firstName:firstName”

  • 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-19T00:28:31+00:00Added an answer on May 19, 2026 at 12:28 am

    A JSF 2.0 composite component is not the same as a JSF 1.x/2.x Facelets template.

    The composite component has its own ID as well. You’re basically reusing it on the components in the implementation of the composite component. You may want to consider to add or rename another ID attribute for the components in the implementation. E.g.

    <my:inputText name="firstName" label="First Name" value="#{nameTO.firstName}" />
    

    with

    <h:inputText id="#{cc.attrs.name}">
    

    It’ll however end up as id="ccId:firstName" in HTML where ccId is either the fixed or autogenerated id of my:inputText. You can also just leave it away and use

    <h:inputText id="input">
    

    Which ends up as id="firstName:input" in HTML.

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

Sidebar

Related Questions

Let's say I've created a simple composite component in one of my JSF 2.0
I created a Rails application normally. Then created the scaffold for an event class.
I'm trying to create a composite component for use in my Seam application, and
I created a jsf custom tag (I'm not sure that it's correct, I could
I've created a JSF application, and I want to embed a link in a
I have created a simple JSF image browsing app, and I'm having a problem
I have a customer who created an Oracle ADF/JSF 1.1 application. On one of
I haven't ever before created custom components in JSF so I've noticed only now
Is there a way to create an html link using h:outputLink, other JSF tag
I created a program using dev-cpp and wxwidgets which solves a puzzle. The user

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.