CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> Tips & Solutions

 Pop-up List & Smart Lookup and return the only found Record automatically

Print topic Send  topic

Author Message
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





View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.