title: @postConstruct method with parameter
body: <p>I've got a list of orders on a database, and I want to show two separate datatables in two JSF pages: one table regarding all orders, and one table regarding the current logged user.
  Problem is, only the first one is actually showed on the page.</p>
  
  <p>JSF page with the datatable links</p>
  
  <pre><code>&lt;h:commandLink action="#{ordineController.listaOrdini}"
          value="Consulta gli ordini esistenti" rendered="#{not empty loginAdmin.admin.email}"/&gt;
      &lt;div&gt;
          &lt;h:commandLink
              action="#{ordineController.listaOrdiniCliente}"
              value="Controlla i tuoi ordini"
              rendered="#{not empty loginCliente.clienteLoggato.email}"&gt;
              &lt;f:setPropertyActionListener target="#{ordineController.clienteCorrente}"
                  value="#{loginCliente.clienteLoggato}" /&gt;
          &lt;/h:commandLink&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>ViewScoped bean</p>
  
  <pre><code>     @ManagedBean(name="ordineController")
  @ViewScoped
  public class OrdineController implements Serializable {
  
  /**
       * 
       */
      private static final long serialVersionUID = 1L;
      @PostConstruct
      public void init() {
          ordini = oFacade.getListaOrdini();
          listaOrdiniCliente();
      } 
      public String listaOrdini() {
          this.ordini = oFacade.getListaOrdini();
          return "showOrdini"; 
      }
  
      public String listaOrdiniCliente() {
          this.ordiniCliente = oFacade.getOrdiniCliente(clienteCorrente);
          return "showOrdiniCliente"; 
      }
  /*Getters and setters*
  </code></pre>
  
  <p>The JSF page that doesn't work (showOrdiniCliente.xhtml)</p>
  
  <pre><code>&lt;h:outputText value="Non c'è nessun ordine."
          rendered="#{empty ordineController.ordiniCliente}" /&gt;
      &lt;h:dataTable id="lista" value="#{ordineController.ordiniCliente}"
          var="ordine" rendered="#{not empty ordineController.ordiniCliente}"&gt;
  </code></pre>
  
  <p>The JSF page that does work (showOrdini.xhtml)</p>
  
  <pre><code>&lt;h:outputText value="Non c'è nessun ordine."
      rendered="#{empty ordineController.ordini}" /&gt;
  &lt;h:form rendered="#{not empty ordineController.ordini}"&gt;
      &lt;h:dataTable id="lista" value="#{ordineController.ordini}"
          var="ordine"&gt;
  </code></pre>
  
  <p>Why is the #{ordineController.ordiniCliente} empty?
  Shouldn't it be builded along with the "ordini" variable in the @PostConstruct?</p>
  
  <p><em>edit</em>
  Facade method (it retrieves all the orders of a customer)</p>
  
  <pre><code>public List&lt;Ordine&gt; getOrdiniCliente (Cliente cliente) {
  
      try {
          TypedQuery&lt;Ordine&gt; q = em.createQuery("SELECT ord FROM Ordine ord WHERE ord.cliente = :cliente", Ordine.class);
          q.setParameter("cliente", cliente);
          return q.getResultList();
  
      } 
      catch (Exception e) {
          String q = "Il cliente " +cliente.getNickname()+ " non ha creato degli ordini";
          System.out.println(q);
          return null;
  
      }
  
  }
  </code></pre>