gbolz
Posts: 13
|
Posted: 11/27/2006, 12:02 PM |
|
In my current project - an intranet solution - I used this example often to help the user selecting customers or orders on the fly. But if you get only one record as result should the needed data go directly in the calling window without extra confirmation.
Look first this link: http://examples.codecharge.com/ExamplePack/PopUpList/PopUpList.php
How I realized this problem in php:
1. Make a hidden textfield near the submit button at the bottom of the grid. I called it ONEREC.
2. Set the default value on 'N'.
3. Insert the following custom code in the AfterExecuteSelect region of the grid.
if($customer->ds->RecordCount == 1)
$customer->ONEREC->SetValue(Y);
4. Insert the following script in the onload client events of the textfield ONEREC
If (document.customer.value == "Y"){
SetOpenerValue(document.all.myCustomerId);
return false;
}
5. Give the field you want to give back the id myCustomerId. As the grid will have one record only this label has only one value.
Now it should work.
Gerry
|
|
|
|