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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:10:53+00:00 2026-05-31T08:10:53+00:00

I have a problem with a binding p:commandButton to a property in a backing

  • 0

I have a problem with a binding p:commandButton to a property in a backing bean. I’ve tried to simplify my code to show general idea.

ExampleBean is a backing bean

public class ExampleBean {

    public String title;        
    List<ExampleWrapper> list;

    // Getters and setters

}

ExampleWrapper is a POJO

public class Wrapper {

    public String name;
    public String description;

    public CommandButton button;

    // Listener which changes button state

    // Getters and setters
}

index.xhtml is a main page:

<h:form>
    <h:outputText value="Title" />
    <p:inpurText value="#{exampleBean.title}"

    <ui:include src="list.xhtml">
        <ui:param name="bean" value="#{exampleBean}">
    </ui:include>
</h:form>

list.xhtml is a fragment I want to be reused in a few places:

<ui:composition ...>
    <ui:repeat id="list" var="exampleWrapper" value="#{bean.list}">
        <h:outputText value="#{exampleWrapper.name}"/>
        <h:outputTextarea value="#{exampleWrapper.description}"/>
        <p:commandButton id="button" binding="#{exampleWrapper.button}" 
            value="Button" />
</ui:composition>

So, I get exception:
javax.el.PropertyNotFoundException: /list.xhtml … binding=”#{exampleWrapper.button}”: Target Unreachable, identifier ‘exampleWrapper’ resolved to null

Without binding attribute everything works and displays fine

Could you explain why and how can I bind button to this POJO property? Any help will be appreciated

I’m using JSF 2.0.2 with Primefaces 3.0.1

  • 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-31T08:10:54+00:00Added an answer on May 31, 2026 at 8:10 am

    The binding (and id) attribute of a JSF UI component is resolved during view build time. The #{exampleWrapper} instance is not available during the view build time. The view build time is that moment when the XHTML file is parsed into a JSF component tree. The #{exampleWrapper} is only available during the view render time. The view render time is the moment when the JSF component tree generates HTML output.

    Basically, there’s only one <p:commandButton> in the component tree which generates its HTML output multiple times as many as the <ui:repeat> iterates. You need to bind it to the #{bean} instead, or to use JSTL <c:forEach> instead of <ui:repeat>. The JSTL tags runs namely during view build time and the <c:forEach> will thus produce physically multiple JSF UI components. But, more than often, binding components to backing beans is unnecessary in JSF 2.x. Whatever functional requirement you’ve had in mind for which you thought that this is the solution, it can definitely be solved in a better way.

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

Sidebar

Related Questions

I have a problem with binding data using BindingSource, typed dataset and DataGridView. My
I have a problem in binding JSON data to KENDO Pie Chart. I have
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
i have a problem with binding a service to an activity in Android. The
I have a problem whit binding in wpf i have a textbox where i
I am a learner and i have a problem data binding the dataset. Please
As the title says, I have a problem with binding to a change in
I have problem in ListView MultiSelection. Here is my code : private ICommand _excludeCurveCommand;
Since including <mvc:annotation-driven/> I have experienced a problem when binding the selections of multi-select
I have a problem with my datagridview that is binding to an access table(access

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.