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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:19:58+00:00 2026-05-27T10:19:58+00:00

I don’t know how to reference descendant components of composite component in update or

  • 0

I don’t know how to reference descendant components of composite component in update or process (alias render or execute).

I have this composite component resources/components/crud.xhtml:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsf/composite">

    <c:interface>
        <c:attribute name="controller" required="true" />
        <c:facet name="fields" required="true"/>
    </c:interface>

    <c:implementation>

        <p:dataTable 
            id="table"
            value="#{cc.attrs.controller.autoResultModel}" 
            var="unit" 
            paginator="true" 
            rows="10" 
            lazy="true"  
            paginatorAlwaysVisible="true"
            paginatorPosition="top"
            paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
            currentPageReportTemplate="{totalRecords} records found, Page: {currentPage}/{totalPages}"
            rowsPerPageTemplate="5,10,15" 
            sortBy="#{unit.creationTime}"
            sortOrder="descending"
            selectionMode="single"
            selection="#{cc.attrs.controller.selected}">

            <p:ajax event="rowSelect" update="editDialog trashDialog table:commands"/>

            <f:facet name="header">
                <h:panelGroup id="commands" layout="block">
                    <p:commandButton id="newButton" value="new" image="ui-icon ui-icon-plusthick" oncomplete="editDialog.show()" actionListener="#{cc.attrs.controller.clearSelected()}" process="@this" update="#{cc.clientId}" />
                    <p:commandButton value="edit" image="ui-icon ui-icon-wrench" onclick="editDialog.show()" type="button" disabled="#{cc.attrs.controller.selected.id == null}"/>
                    <p:commandButton value="delete" image="ui-icon ui-icon-trash" onclick="trashDialog.show()" type="button" disabled="#{cc.attrs.controller.selected.id == null}"/>
                </h:panelGroup>
            </f:facet>

            <c:insertChildren/>

        </p:dataTable>

        <h:panelGroup id="editDialog">
            <p:dialog modal="true" widgetVar="editDialog" showEffect="fold" hideEffect="puff"> 

                <f:facet name="header">
                    <h:outputText value="#{bundle['create']}" rendered="#{cc.attrs.controller.selected.id == null}"/>
                    <h:outputText value="#{bundle['update']}" rendered="#{cc.attrs.controller.selected.id != null}"/>
                </f:facet> 

                <h:panelGroup layout="block">

                    <c:renderFacet name="fields"/>

                    <br/>

                    <p:commandButton value="#{bundle['create']}" actionListener="#{cc.attrs.controller.create}" process="editDialog" update="table" oncomplete="closeDialog(xhr, status, args, editDialog)" rendered="#{cc.attrs.controller.selected.id == null}"/>
                    <p:commandButton value="#{bundle['update']}" actionListener="#{cc.attrs.controller.update}" process="editDialog" update="table" oncomplete="closeDialog(xhr, status, args, editDialog)" rendered="#{cc.attrs.controller.selected.id != null}"/>
                    <p:commandButton value="#{bundle['copy']}" actionListener="#{cc.attrs.controller.create}" process="editDialog" update="table" oncomplete="closeDialog(xhr, status, args, editDialog)" rendered="#{cc.attrs.controller.selected.id != null}">
                        <f:setPropertyActionListener target="#{cc.attrs.controller.selected.id}" value="#{null}"/>
                    </p:commandButton>
                </h:panelGroup>

            </p:dialog>

        </h:panelGroup>

        <p:dialog modal="true" header="asdasd" widgetVar="trashDialog" hideEffect="explode" showEffect="explode"> 
            <h:panelGroup id="trashDialog" layout="block">
                <h:outputText value="#{bundle['trashconfirm']}">
                    <f:param name="name" value="#{cc.attrs.controller.selected.name}"/>
                </h:outputText>
            </h:panelGroup>

            <p:commandButton value="#{bundle['confirm']}" actionListener="#{cc.attrs.controller.destroy}" process="@this" update="table" oncomplete="closeDialog(xhr, status, args, trashDialog)"/>
        </p:dialog>
    </c:implementation>
</html>

called by this page test.xhtml:

<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:cc="http://java.sun.com/jsf/composite/components">


    <h:head>
        <title>Default Title</title>
        <h:outputStylesheet name="css/screen.css"/>
        <h:outputScript name="js/common.js"/>
    </h:head>

    <h:body>

        <p:growl id="messages" autoUpdate="true"/>

        <h:form id="itemForm">

            <cc:crud id="itemCrud" controller="#{itemController}">

                <f:facet name="fields">
                    <h:panelGrid columns="3">
                        <h:outputLabel value="manufacturer" for="manufacturer"/>
                        <p:selectOneMenu id="manufacturer" value="#{itemController.selected.manufacturer}" converter="#{manufacturerController.converter}">
                            <f:selectItems value="#{manufacturerController.facade.findAll()}" var="e" itemLabel="#{e.title}" itemValue="#{e}"/>
                        </p:selectOneMenu>
                        <p:message for="manufacturer"/>

                        <h:outputLabel value="partNumber" for="partNumber"/>
                        <p:inputText id="partNumber" value="#{itemController.selected.partNumber}"/>
                        <p:message for="partNumber"/>

                        <h:outputLabel value="configurationIndex" for="configurationIndex"/>
                        <p:inputText id="configurationIndex" value="#{itemController.selected.configurationIndex}"/>
                        <p:message for="configurationIndex"/>
                    </h:panelGrid>
                </f:facet>

                <p:column headerText="#{bundle['manufacturer']}" filterBy="#{unit.manufacturer.title}" sortBy="#{unit.manufacturer.title}">
                    #{unit.manufacturer.title}
                </p:column>

                <p:column headerText="#{bundle['partNumber']}" filterBy="#{unit.partNumber}" sortBy="#{unit.partNumber}">
                    #{unit.partNumber}
                </p:column>

                <p:column headerText="#{bundle['configurationIndex']}" filterBy="#{unit.configurationIndex}" sortBy="#{unit.configurationIndex}">
                    #{unit.configurationIndex}
                </p:column>

                <p:column headerText="#{bundle['modifyStatus']}" filterBy="#{unit.modifyStatus}" sortBy="#{unit.modifyStatus}">
                    #{unit.modifyStatus}
                </p:column>

                <p:column headerText="#{bundle['description']}" filterBy="#{unit.description}" sortBy="#{unit.description}">
                    #{unit.description}
                </p:column>

            </cc:crud>

        </h:form>
    </h:body>
</html>

And I have this output:

AVVERTENZA: PWC4011: Unable to set request character encoding to UTF-8 from context /epcsdb, because request parameters have already been read, or ServletRequest.getReader() has already been called
INFO: Skipping call to libraryExists().  Please set context-param com.sun.faces.enableMissingResourceLibraryDetection to true to verify if library http://java.sun.com/jsf/composite/components actually exists
INFO: Cannot find component with identifier "itemForm:itemCrud:table:newButton" in view.
INFO: Cannot find component with identifier "itemForm:itemCrud" in view.
INFO: Cannot find component with identifier "editDialog" in view.
INFO: Cannot find component with identifier "trashDialog" in view.
INFO: Cannot find component with identifier "itemForm:itemCrud:j_idt34" in view.

Result of this is that no component is updated with any ajax call. I don’t understand why “itemForm:itemCrud:table:newButton” cannot be found. It is only referenced with process="@this".

I’m using primefaces 3.0.RC1-SNAPSHOT and Mojarra 2.1.3_01.

  • 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-27T10:19:59+00:00Added an answer on May 27, 2026 at 10:19 am

    You need to prefix absolute client IDs with the NamingContainer separator which is by default :.

    update=":#{cc.clientId}"
    

    See also:

    • How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar"
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't know if this has been answered before. Have custom routes to users. If
Don't know why but I can't find a solution to this. I have 3
(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't know if this has been asked before, so point me to another question
Don't know if anyone can help me with this or if it's even possible.
Don't they both have to convert to machine code at some point to execute
I don't know: if this works. if it's a good idea. what it is
I don't know if this question is trivial or not. But after a couple
Don't overthink this - there's a very commonly used term and I ... have
Don't know if this is the right place to ask this, but I will

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.