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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:46:02+00:00 2026-05-26T21:46:02+00:00

i have a composite component that contains a form with ajax. what i can’t

  • 0

i have a composite component that contains a form with ajax. what i can’t figure out is why it only works for the @form/@all render parameter.

    <cc:interface>
    <cc:attribute name="radioItem"/>
    <cc:attribute name="radioItems" />
    <cc:attribute name="compImage" />
    <cc:attribute name="compSpecification"/>

    </cc:interface>

<!-- IMPLEMENTATION -->
<cc:implementation>
    <h:form> 
        <div id="options">
            <h:selectOneRadio value="#{cc.attrs.radioItem}" >
                <f:selectItems value="#{cc.attrs.radioItems}" />
                <f:ajax render=":details" />
    </h:selectOneRadio>
        </div>

        <div id="details">
            <h:graphicImage value="#{cc.attrs.compImage}"/>
            <h:outputText value="#{cc.attrs.compSpecification}"/>
        </div>      
   </h:form> 
</cc:implementation>

What am i missing?

  • 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-26T21:46:02+00:00Added an answer on May 26, 2026 at 9:46 pm

    This problem is two-fold:

    1. You’re specifying an absolute client ID :details while the element to be re-rendered is inside the same UINamingContainer parent, so JSF won’t be able to locate it in the component tree. You need to specify a relative client ID details.

    2. You have specified the ID on a plain vanilla HTML element instead of a real JSF component, so JSF won’t be able to locate it in the component tree. You need to use a real JSF component. You need to replace <div> by <h:panelGroup layout="block">.

    So, fix it both:

    <h:form> 
        <div id="options">
            <h:selectOneRadio value="#{cc.attrs.radioItem}" >
                <f:selectItems value="#{cc.attrs.radioItems}" />
                <f:ajax render="details" />
            </h:selectOneRadio>
        </div>
    
        <h:panelGroup id="details" layout="block">
            <h:graphicImage value="#{cc.attrs.compImage}"/>
            <h:outputText value="#{cc.attrs.compSpecification}"/>
        </h:panelGroup>      
    </h:form> 
    

    That it works with @form and @all is just because JSF can locate the element to be re-rendered relative to the component on which the ajax action is been invoked, namely the parent UIForm and UIViewRoot component respectively.

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

Sidebar

Related Questions

I have to write a composite component that shows a login form and can
I have a JSF 2 composite component that employs some Ajax behavior. I want
I have created a composite component, based on PrimeFaces components that works as a
I have a Facelets Composite component that includes, among other things, a commandButton: <?xml
I have an array list that could contain component or composite and each component
I have a composite component, which represents an item that will be stored in
I have a composite component (a navigation bar) that takes a variable called 'activeIndex'
I have created a composite component in JSF2. I works great. I would like
My problem in brief is that I have a composite component with a componentType
A pretty normal case: We have a 'portlet' composite component that has two states:

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.