title: Datatable items set to null upon commandLink action
body: <p>If I run the app and click the first <code>p:commandLink</code>, the <code>item</code> gets set as expected. When clicking another <code>p:commandLink</code> the previous one will be removed (null). The <code>h:commandLink</code> does not have that problem.</p>
  
  <p>If I add <code>:theform:output</code> to the <code>update</code> parameter of the <code>p:commandLink</code>, the previously clicked item stops disappearing.</p>
  
  <p>What is the reason for this behaviour?</p>
  
  <p><strong>Env</strong></p>
  
  <ul>
  <li>Java 1.7.45</li>
  <li>Netbeans 7.4</li>
  <li>JSF Mojarra 2.2.4</li>
  <li>Primefaces 4.0</li>
  </ul>
  
  <p><strong>Index.xhtml</strong></p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
        xmlns:p="http://primefaces.org/ui"&gt;
      &lt;h:head&gt;
          &lt;title&gt;Test&lt;/title&gt;
      &lt;/h:head&gt;
      &lt;h:body&gt;
          &lt;h:form id="theform"&gt;
              &lt;h:panelGroup layout="block" styleClass="tableBorder" id="tableWrapper"&gt;
                  &lt;h:dataTable value="#{xtestListBean.list}" var="item"&gt;
                      &lt;h:column&gt; 
                          &lt;h:outputText value="#" styleClass="tableItem" /&gt;
                      &lt;/h:column&gt;
                      &lt;h:column&gt; 
                          &lt;h:commandLink 
                              value="#{item.name}" 
                              actionListener="#{xtestEntityBean.setItem(item)}"&gt;
                              &lt;f:ajax render=":theform:tableWrapper" /&gt;
                          &lt;/h:commandLink&gt;
                          &lt;p:commandLink 
                              value="#{item.name}" 
                              actionListener="#{xtestEntityBean.setItem(item)}"
                              update=":theform:tableWrapper"&gt;
                          &lt;/p:commandLink&gt;
                      &lt;/h:column&gt;
                  &lt;/h:dataTable&gt;
              &lt;/h:panelGroup&gt;
              &lt;h:inputText value="#{xtestEntityBean.item.name}" size="40" id="output" /&gt;
          &lt;/h:form&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>XtestListBean.java</strong></p>
  
  <pre><code>package beans;
  
  import dto.Item;
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.List;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.ViewScoped;
  
  @ManagedBean
  @ViewScoped
  public class XtestListBean implements Serializable {
  
      private List&lt;Item&gt; list;
  
      public XtestListBean() {
          list = new ArrayList();
          list.add(new Item("Test 1"));
          list.add(new Item("Test 2"));
          list.add(new Item("Test 3"));
          list.add(new Item("Test 4"));
          list.add(new Item("Test 5"));
          list.add(new Item("Test 6"));
          list.add(new Item("Test 7"));
      }
  
      public List&lt;Item&gt; getList() {
          return list;
      }
  }
  </code></pre>
  
  <p><strong>XtestEntityBean.java</strong></p>
  
  <pre><code>package beans;
  
  import dto.Item;
  import java.io.Serializable;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.ViewScoped;
  import javax.faces.context.FacesContext;
  
  @ManagedBean
  @ViewScoped
  public class XtestEntityBean implements Serializable {
  
      private Item item = new Item();
  
      public XtestEntityBean() {
      }
  
      public void setItem(Item item) {
          this.item = item;
      }
  
      public Item getItem() {
          return item;
      }
  
      public String getVersion() {
          return FacesContext.class.getPackage().getImplementationTitle()
                  + " version "
                  + FacesContext.class.getPackage().getImplementationVersion();
      }
  }
  </code></pre>