CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Smart lookup -- Please Help!!!

Print topic Send  topic

Author Message
rookie
Posted: 08/23/2004, 12:12 AM

Im trying to implement the Pop-up & Smart Lookup example that came with CCS,
all
work fine ( no errors) but it doesn send the selected data to the "parent
page"...
The diference between the example and my implementation, is that Im using a
Editable Grid instead of a record Grid (departments), because the user
should
be able to select more than one option (the user selects in the pop-up, it
automatically go to the "parent", if he needs to add another option, he
repeats
the operation)

I did the example by my self and it works.... What I need to change in my
implementacion?

I'm using IIS, ASP & ACCESS 2002

Thanks...


phaider

Posts: 37
Posted: 08/24/2004, 2:52 AM

Rookie,

that's not easy, but also not impossible.

The big difference between Record page and Editable grid is, that all the fields in the rows, gets a new property, called "external name".

So for example, if you have a field "surname" in the row, the fieldname in the first displayed row is "surname_1", in the second row "surname_2", in the third row "surname_3" and so on. Your javascript has to take care of this.

Assume that:

- the caller form name (in the editable grid) is "myaddresstable"
- we will lookup from the field "surname":

- the called window page name is "myaddresslist.asp" (grid)

In the Caller Page:
==============
Add an image next the control, where you want to have to smart lookup. Insert a client side event:

onclick="window.open('myadresslist.asp?SelectedFieldName={surname_Name}','MyWindowTitle','width=400,height=250,location=no,status=no,menubar=no,toolbar=no,scrollbars=no,dependent=yes"');"

Remark: SelectedFieldName = HiddenTextbox in the called form!!!

In the Called Page:
===============

Build a grid and add a anchor (link) to select the right entry.

Add a client side event like on the anchor:

onclick="myselect('{the_requested_lookup_field}');"

Add a javascript function in the header

function myselect(par1)
{
window.opener.document.all[document.getElementById("SelectedFieldName").value].value = par1;
window.close();
}

So when you click on the anchor (Link) in the called page, the script returns the value in the fieldname of the caller page. The Fieldname itself is stored in the hidden textbox "SelectedFieldName", and was transfer by the querystring from the caller page.

Thats it. Happy Coding! (Take care of Javascript - its case sensitive)

Rgds

Peter
View profile  Send private message
rookie
Posted: 08/26/2004, 3:18 PM

it doesn work...!

Can you sand me a sample?

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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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