title: How to get row index of selected row in PrimeFaces data table using jsf 2.2
body: <p>for example I am using this datatable</p>
  
  <pre><code>&lt;h:form&gt;
          &lt;p:dataTable var="item" value="#{kilowatManager.show}"&gt;
              &lt;p:column headerText="Id"&gt;
                  &lt;h:outputText value="#{kilowatManager.kilowat.id}" /&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Name"&gt;
                  &lt;h:outputText value="#{kilowatManager.kilowat.name}" /&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="kWH"&gt;
                  &lt;h:outputText value="#{kilowatManager.kilowat.kwh}" /&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="kWD"&gt;
                  &lt;p:inputText value="#{kilowatManager.kilowat.kwd}"/&gt;
              &lt;/p:column&gt;
          &lt;/p:dataTable&gt;
      &lt;/h:form&gt;
  </code></pre>
  
  <p>How can I get values of selected row after pressing ENTER key in input text</p>