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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:17:58+00:00 2026-06-06T00:17:58+00:00

I have a query here regarding the value given to the update attribute of

  • 0

I have a query here regarding the value given to the update attribute of the primefaces command button.

Here is a simple code. I have a simple xhtml page

<h:body>
<h:form id="main">
    <p:growl id="maingrowl" showDetail="true"></p:growl>
    <p:panelGrid id="mainpanel" columns="2">

            <p:commandButton value="Ajax Submit" update="test" id="ajax"
                actionListener="#{mytestBean.display}" />


    </p:panelGrid>

    <p:panelGrid id="test" rendered="#{mytestBean.show}" columns="1">
        <h:inputText value="#{mytestBean.val1}" />
        <h:inputText value="#{mytestBean.val2}" />
        <p:commandButton value="value in" id="aj" update="test"
            actionListener="#{mytestBean.displaysec}">
            </p:commandButton>
    </p:panelGrid>

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

Now, If I have to update the panelgrid “test” then in the first command button I have to provide the id “test” prefixed with “:main:” in the update attribute of the command button since that is the exact id in the HTML DOM as I find it in the view source in the browser. But, I was able to update even by given just “test” in the update attribute.
So my question here is when should I use the “:” in the id or is it mandatory or is there any pre defined rule to give the id’s in the attribute?

Also, I am aware of the fact that the id given in the update attribute is through the UINamingContainer in which it is placed. Please pardon me if its trivial, I am really confused here.

Any help greatly appreciated.
Thank you.

  • 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-06-06T00:18:00+00:00Added an answer on June 6, 2026 at 12:18 am

    If both components (the one to update and the one that triggers the update) are inside the same NamingContainer, the relative client id withoud the : is sufficient.

    NamingContainers in jsf are all those components that prepend their own id to the client id of all child components, e.g. <h:form>, <h:dataTable> or <ui:repeat> (or to be more precise: all components that implement the javax.faces.component.NamingContainer interface).

    If both components are not inside the same NamingContainer, you have to use the absolute id beginning with a : from the view root.

    If you are interested in more detailed information I recommend reading the javadoc of the UIComponent#findComponent() method where the search algorithm is described.

    Note that the : is the default character to separate segments of a clientId. You can change it with a context parameter in your web.xml.

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

Sidebar

Related Questions

Right, starting to go crazy here. I have the following code: var query =
I'm stuck with another coordinates related query here. I have a number of CSV
I have this query which works correctly in MySQL. More background on it here
Here is a silly question. Lets say I have a query that produces for
We have a Union Query. Here's a basic (similar) example: SELECT a.Name, b.Info FROM
Here is the query which will get me all the contacts have HD quality
I have a problem with (for me to complicated) MySql query. Okay, here is
I have been having a query regarding writing unit tests for web methods which
I have this logical problem regarding on how to pass value from one JFrame
Me and my colleagues have a question regarding SQL Server 2008 query length and

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.