title: Navigate to other view passing a parameter
body: <p>My current environment is JRE 1.7, JSF 2.2, Eclipse Luna. In a certain page (<code>entity_index.xhtml</code>) of my application I have the following (PrimeFaces) button:</p>
  
  <pre><code>&lt;p:commandButton value="Details" action="entity_details"
                   ajax="false" onclick="this.form.target='_blank'"&gt;
      &lt;f:param name="id" value="#{entity.id}" /&gt;
  &lt;/p:commandButton&gt;
  </code></pre>
  
  <p>The idea is to provide a button so the user can click it and some details on the current entity will be shown in another browser tab (page <code>entity_details.xhtml</code>). This is one button of many, so the <code>entity_index.xhtml</code> page shows many instances of Entity, each one with a details button.</p>
  
  <p>The button works in the sense a new tab opens and that the correct page (<code>entity_details.xhtml</code>) is shown, but the entity id never gets to the bean that handles the detail page (<code>EntityDetailsMB</code>). The details page is as follows:</p>
  
  <pre><code>&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:dsi="http://www.cce.ufpr.br"
      template="/private/template/sbadmin.xhtml"&gt;
  &lt;f:metadata&gt;
      &lt;f:viewParam name="id" value="#{entityDetailsMB.id}"/&gt;
  &lt;/f:metadata&gt;
  
  &lt;ui:define name="content"&gt;
  &lt;h2 class="page-header"&gt;#{entityDetailsMB.entity.name}&lt;/h2&gt;
  &lt;h:form id="form"&gt;
  ...
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>Notice that there is a <code>&lt;f:metadata/&gt;</code> element dedicated to capture the parameter sent from the index page and forward it to the <code>id</code> property in <code>EntityDetailsMB</code>, where there is the following:</p>
  
  <pre><code>public Entity getEntity() {
      return entityById(id);
  }
  
  public Long getId() {
      return id;
  }
  
  public void setId(Long value) {
      id = value;
  }
  </code></pre>
  
  <p>Because the <code>setId()</code> method is never called, <code>getEntity()</code> always returns <code>null</code>.</p>
  
  <p>What is missing to make it to work?</p>