title: How to bind JSF component to backing bean property
body: <p>I have a problem with a binding <code>p:commandButton</code> to a property in a backing bean. I've tried to simplify my code to show general idea.</p>
  
  <p>ExampleBean is a backing bean</p>
  
  <pre><code>public class ExampleBean {
  
      public String title;        
      List&lt;ExampleWrapper&gt; list;
  
      // Getters and setters
  
  }
  </code></pre>
  
  <p>ExampleWrapper is a POJO</p>
  
  <pre><code>public class Wrapper {
  
      public String name;
      public String description;
  
      public CommandButton button;
  
      // Listener which changes button state
  
      // Getters and setters
  }
  </code></pre>
  
  <p>index.xhtml is a main page:</p>
  
  <pre><code>&lt;h:form&gt;
      &lt;h:outputText value="Title" /&gt;
      &lt;p:inpurText value="#{exampleBean.title}"
  
      &lt;ui:include src="list.xhtml"&gt;
          &lt;ui:param name="bean" value="#{exampleBean}"&gt;
      &lt;/ui:include&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>list.xhtml is a fragment I want to be reused in a few places:</p>
  
  <pre><code>&lt;ui:composition ...&gt;
      &lt;ui:repeat id="list" var="exampleWrapper" value="#{bean.list}"&gt;
          &lt;h:outputText value="#{exampleWrapper.name}"/&gt;
          &lt;h:outputTextarea value="#{exampleWrapper.description}"/&gt;
          &lt;p:commandButton id="button" binding="#{exampleWrapper.button}" 
              value="Button" /&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>So, I get exception:
      javax.el.PropertyNotFoundException: /list.xhtml ... binding="#{exampleWrapper.button}": Target Unreachable, identifier 'exampleWrapper' resolved to null</p>
  
  <p>Without <code>binding</code> attribute everything works and displays fine</p>
  
  <p>Could you explain why and how can I bind button to this POJO property? Any help will be appreciated</p>
  
  <p>I'm using JSF 2.0.2 with Primefaces 3.0.1</p>