title: <a4j:commandLink> - execute bean method
body: <p>I have two rich:dataTables on one form:</p>
  
  <p><strong>1]</strong> List of items (last column contains a4j:commandLink according to <a href="http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=dataTable&amp;skin=blueSky" rel="nofollow">this tutorial</a>)</p>
  
  <p><strong>2]</strong> Table depended on choosed row in the first table</p>
  
  <p>Last column of first table:</p>
  
  <pre><code>&lt;rich:column&gt;
    &lt;a4j:commandLink&gt;
      &lt;h:graphicImage value="/images/icons/edit.png" alt="edit"/&gt;
      &lt;a4j:param value="#{it.index}" assignTo="#{myBdeCheck.currentIndex}" /&gt;
      &lt;f:setPropertyActionListener target="#{myBdeCheck.editedWork}" value="#{bchItem}" /&gt;
    &lt;/a4j:commandLink&gt;
  &lt;/rich:column&gt;
  </code></pre>
  
  <p>CommandButton in the facet of the second dataTable:</p>
  
  <pre><code>&lt;h:commandButton id="btnCheck" action="#{myBdeCheck.edit}" value="#{conf.buttonEdit}"/&gt;
  </code></pre>
  
  <p>At this moment I have to press a4j:commandLink (edit) and after that button on second form, and after that correct items are shown. But I'm doing one thing using two buttons. </p>
  
  <p>How can I show the right items in the second datatable directly pressing a4j:commandLink?</p>
  
  <p>(I tried to move <code>action="#{myBdeCheck.edit}"</code> to commandLink, but it doesn't work.) </p>
  
  <p>Could you help me?</p>
  
  <p><strong>UPDATE:</strong> edit method: </p>
  
  <pre><code>public void edit()
  {
    session = DaoSF.getSessionFactory('R').openSession();
    try 
    {
      Criteria criteria = session.createCriteria(BDE.class);
      (some restrictions...)
      dataList = criteria.list();
    } catch {......}
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong> part of rich:dataTable:</p>
  
  <pre><code>&lt;rich:extendedDataTable 
    id="rich2"
    value="#{myBdeCheck.dataList}"
    var="bdeItem"&gt;
  
  &lt;rich:column&gt;
    &lt;f:facet name="header"&gt;
      &lt;h:outputText value="PersId" /&gt;
    &lt;/f:facet&gt;
    &lt;h:outputText value="#{bdeItem.personalNum}"/&gt;
  &lt;/rich:column&gt;
  (.....)
  </code></pre>