People have problems with that all the time.
IMO the best way is for you to be the master running the details.
Try this demo script and double click on something in the left grid
405hp.net/d4php/tutcompare.php (This was comparing 2 ajax methods for a speed test.)
Double click on left gets a new right, uses basicAjax.
The button does the same uses vcl xajax.
This is the code to make the button click happen. (it also requires a hidden field to hold the selection)
PHP Code:
function BitBtn1JSClick($sender, $params)
{
?>
document.getElementById('HFpbSelect').value=dbgpbindex.getTableModel().getValue(2,dbgpbindex.getFocusedRow());
dbgpricebook.setFocusedCell(0, 0, true);
dbgpricebook.getSelectionModel().setSelectionInterval(0, 0);
<?php
echo $this->$dbgpbindex->ajaxCall(ajaxIndexclicked,null,array("HFpbSelect","dbgpricebook"));
}
function ajaxIndexclicked($sender, $params)
{
$this->QPricebook->LimitStart=0;
$this->QPricebook->LimitCount=100;
$sql="SELECT `prod` , `unit` , `size` ,`brand` , `descr` , `serving` , `servsize` , `servunit` , `onhand` , `duedate`, `has_2ndlines`, `has_pic` FROM products WHERE prod >=".$this->HFpbSelect->value;
$this->QPricebook->SQL=$sql;
$this->QPricebook->Refresh();
}