title: DataGrid not getting selected item - Primefaces
body: <p>Here's my problem:
  When I click on the view detail on my datagrid, it does not show the informations of the selected item, it shows only the labels with blank infos... i followed all steps on the primefaces showcase and i cant find the problem</p>
  
  <p>Grid:</p>
  
  <pre><code>&lt;h:body&gt;       
      &lt;f:view&gt;
          &lt;h:form id="form"&gt;
      &lt;p:dataGrid var="item" value="#{equipamentosControle.lista}" columns="3"  
      rows="12" paginator="true"  
      paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink}                 
      {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
      rowsPerPageTemplate="9,12,15"&gt;  
  
      &lt;p:panel header="#{item.idEquip}" style="text-align:center"&gt;  
          &lt;h:panelGrid columns="1" style="width:100%"&gt;                     
  
              &lt;h:outputText value="#{item.nomeEquip}" /&gt;  
  
              &lt;p:commandLink update=":form:equipDetail" oncomplete="equipDialog.show()" title="Ver Detalhes"&gt;  
                  &lt;h:outputText styleClass="ui-icon ui-icon-search" style="margin:0 auto;" /&gt;   
                  &lt;f:setPropertyActionListener value="#{item}"   
                                        target="#{equipamentosControle.selectedEquip}" /&gt;  
              &lt;/p:commandLink&gt;  
  
          &lt;/h:panelGrid&gt;  
      &lt;/p:panel&gt;  
  
  &lt;/p:dataGrid&gt;  
  
  &lt;p:dialog header="Detalhes do equipamento" widgetVar="equipDialog" modal="true"&gt;  
      &lt;p:outputPanel id="equipDetail" style="text-align:center;" layout="block"&gt;  
  
  
          &lt;h:panelGrid  columns="2" cellpadding="5"&gt;  
              &lt;h:outputLabel for="nomeEquip" value="Nome: " /&gt;  
              &lt;h:outputText id="nomeEquip" value="#{equipamentosControle.selectedEquip.nomeEquip}" /&gt;  
  
              &lt;h:outputLabel for="descEquip" value="Descrição: " /&gt;  
              &lt;h:outputText id="descEquip" value="#{item.descEquip}" /&gt; &lt;!-- I also tried this way.. --&gt;
     &lt;/h:panelGrid&gt;  
          &lt;/p:outputPanel&gt;  
        &lt;/p:dialog&gt; 
        &lt;/h:form&gt;
      &lt;/f:view&gt;
   &lt;/h:body&gt;                                 
  </code></pre>
  
  <p>and here is the managed bean:</p>
  
  <pre><code>@ManagedBean
  @SessionScoped
  public class EquipamentosControle {
   private Equipamentos equ = new Equipamentos();
  EntityManager em = GeraEntityManager.getInstance().getEntityManager();
  private List&lt;Equipamentos&gt; lista = new ArrayList&lt;Equipamentos&gt;();
  private Equipamentos selectedEquip;
  </code></pre>
  
     
  
  <pre><code>public Equipamentos getSelectedEquip() {  
      return selectedEquip;  
  }  
  
  public void setSelectedEquip(Equipamentos selectedEquip) {  
      this.selectedEquip = selectedEquip;  
  }
  </code></pre>
  
  <p>Any ideas on what i did wrong?</p>