title: Using jsf.ajax.request from Javascript to do AJAX calls in JSF 2.0
body: <p>Some background: I have two 'h:dataTable' elements in my .xhtml page. When the users right click on a cell in the first datatable, the page shows a context menu. Selecting a particular menu item from this context menu should ideally update the contents of the other datatable.</p>
  
  <p>To implement this, I created a javascript function in JQuery that uses jsf.ajax.request() to send an AJAX request to my backing bean. This call looks like the following:</p>
  
  <pre><code>jsf.ajax.request($eventCell, null, {execute: 'selectedRowId selectedColumnId',
                                      render: bugsTable,
                                      assignBugMode : "1",
                                      reportsToCompare : $('input[id$="reportsToCompare"]').val(),
                                      cellRowId: $.trim($rowId),
                                      cellColumnId: $.trim($columnId)
                                      });
  </code></pre>
  
  <p>Here, "bugsTable" is the id of the second h:dataTable element that needs to be updated after the AJAX call returns. "selectedRowId" and "selectedColumnId" are 'h:inputText' elements on the .xhtml page that I need to process on the server side in order to calculate the correct values to be shown in bugsTable.</p>
  
  <p>What I am observing is: when I send the AJAX request to the server, the execute portion of JSF lifecycle gets executed correctly, but the "bugsTable" element does not get updated. In firebug, I could see that the AJAX request resulted into following response from the server:</p>
  
  <pre><code>&lt;partial-response&gt;
  &lt;changes&gt;
  &lt;update id="javax.faces.ViewState"&gt;2177233720285299449:-1589577009450482760&lt;/update&gt;
  &lt;/changes&gt;
  &lt;extension primefacesCallbackParam="validationFailed"&gt;{"validationFailed":false}&lt;/extension&gt;
  &lt;/partial-response&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>