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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:19:24+00:00 2026-05-18T04:19:24+00:00

I have the following Java Server Faces 2.0 composite component. Notice i am using

  • 0

I have the following Java Server Faces 2.0 composite component. Notice i am using verbatim

resources/customer/customer.xhtml

<composite:interface>
    <composite:attribute name="id" required="false"/>
    <composite:attribute name="firstName" required="false"/>
    <composite:attribute name="lastName" required="false"/>
    <composite:attribute name="age" required="false"/>
    <composite:attribute name="rendered" required="false"/>
</composite:interface>
<composite:implementation>
    <f:verbatim id="#{cc.attrs.id}" rendered="#{cc.attrs.rendered}">
        <div>
            <div>
                <p>First name</p>
                <h:outputText value="#{cc.attrs.firstName}"/>
            </div>
            <div>
                <p>Last name</p>
                <h:outputText value="#{cc.attrs.lastName}"/>
            </div>
            <div>
                <p>Age</p>
                <h:outputText value="#{cc.attrs.age}"/>
            </div>
        </div>
    </f:verbatim>
</composite:implementation>

In order to use ajax, i have done (Notice render attribute)

<h:form id="search">
<div>
    <h:commandButton value="Search" action="#{customerSearchController.search}">
        <f:ajax execute="@form" render="search:result"/>
    </h:commandButton>
</div>
<customer:customer id="result"
                   rendered="#{customerSearchController.customer != null}"
                   firstName="#{customerSearchController.customer.firstName}"
                   lastName="#{customerSearchController.customer.lastName}"
                   age="#{customerSearchController.customer.age}"/>
</h:form>

My CustomerSearchController is shown as follows

private Customer customer;

// getter's and setter's

public void search() {
    customer = new Customer();

    customer.setFirstName("First");
    customer.setLastName("Last");

    customer.setAge(30);
}

Both CustomerSearchController and Customer are managed beans. But when i call ajax request, it complains: search:result not found

What should do i to solve this issue ???

  • 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-18T04:19:24+00:00Added an answer on May 18, 2026 at 4:19 am

    <f:ajax render> should point to an existing client ID in the HTML DOM tree. However, since search:result element is not available in the HTML DOM tree because it’s not rendered by the server side, JS/ajax cannot find anything in HTML DOM tree to update/render.

    Wrap it in another element which is always available in the HTML DOM tree so that Ajax can locate it.

    <h:panelGroup id="result">
        <customer:customer rendered="..." />
    </h:panelGroup>
    

    Unrelated to the actual problem, note that f:verbatim is supposed to contain only verbatim (plain HTML), not JSF components. Replace it by h:panelGroup.

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

Sidebar

Related Questions

I have a very simple Java RMI Server that looks like the following: import
I have the following issue using java 1.4 I try to display a very
I have the following problem in my Data Structures and Problem Solving using Java
I am currently looking in to some file uploading using Java Server Faces. I've
I have the following Java 6 code: Query q = em.createNativeQuery( select T.* +
I have the following java class with the JAXB @XMLRootElement annotation @XmlRootElement(name=ClientData) public class
I'm converting an application to use Java 1.5 and have found the following method:
I have a Java file TestThis.java like the following: class A { public void
(All of the following is to be written in Java) I have to build
I have a maven project with the following packages (for illustration only): Root: src/main/java

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.