CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 [SOLVED-Thanks Rick!]How to pass a parameter to an Ajax Service page?

Print topic Send  topic

Author Message
joejac

Posts: 242
Posted: 06/13/2009, 8:03 AM

Hello,

1.- I have page_1.php passing a set of 6 parameters to page_2.php
2.- In page_2.php I have an Ajax 3 Dependent Listboxes working good
3.- Now I need the 3rd dependent listbox of page_2.php that depends also on parameter_3 that I see clear that is been passed in the URL from the page_1.php
3.1 I have a hidden field for parameter_3 in page_2.php
3.2 I clicked "Preserve Parameters" on the record form of page_2.php but no parameter is passed to the Ajax Service page that populates the 3rd. listbox, my question is:


4.- When I change the second listbox, How can I do to pass a parameter to the Ajax Service page that service the third listbox, that can be used as an URL parameter in the Visual Query Builder of the Data Source of the Service Page?

Please note that this parameter is fixed after the person leaves page_1.php.
Thanks a lot
joejac
View profile  Send private message
mentecky

Posts: 321
Posted: 06/14/2009, 8:03 AM

joejac,

Is the listbox on page 2 only dependent of parameter_3?

Rick
_________________
http://www.ccselite.com
View profile  Send private message
joejac

Posts: 242
Posted: 06/14/2009, 8:38 AM

Hello Rick,

Thanks a lot for your reply.

No, Listbox 3 depends also on Listbox 2 of same page_2.php through an Ajax Feature: Dependent Listbox.

My problem is to pass this parameter to the Ajax service page for Listbox3 when the visitor changes the Listbox 2 on page_2.php. The parameter_3 comes from page_1.php and I store it in a hidden field as per your suggestion in other post.

I do the trick passing the parameter manually to the service page and it works fine because I set the Visual Query Builder to filter also by the parameter_3. Please see my test URL:

  
http://localhost/customer/services/page_2_form_listbox3_field3_id_PTDependentListBox2.php?keyword=8¶meter_3_id=31  

where:

1.- keyword=8 is the Bound Column of listbox2 (field2_id=8) but CCS Ajax call all Bound columns "keyword" this is automatically done by the Ajax Dependent Listbox feature.

2.- I enter manually in the URL this: ¶meter_3_id=31 this is what I need to be passed when listbox2 is changed, fortunately it do not change with listbox2, parameter_3_id is fixed because was already set in the previous page, and no matter the changes on the 3 Ajax Dependant listboxes, it is going to be the same.

Hope I was able to explain myself

Rick, I need to have this working for tomorrow, please let me know your fee, I understand.

If you need the project files I can send it to you.

I appreciate a lot your help.
Best regards
joejac
View profile  Send private message
mentecky

Posts: 321
Posted: 06/14/2009, 8:54 AM

joejac,

I think the real shortcut here may be a session variable...

In page_2 Before Show add something like:
CCSetSession("parameter_3", CCGetParam("parameter_3",""));

Then in your query builder for the service set the where clause for parameter_3 to "Expression" instead of URL. The expression would be:
CCGetSession("parameter_3", "")

That should work because sessions will carry over Ajax.

Hope that works for you!

Rick
_________________
http://www.ccselite.com
View profile  Send private message
joejac

Posts: 242
Posted: 06/14/2009, 10:24 AM

Hello Rick,

It worked, Great and fast solution!

Best regards
joejac
View profile  Send private message
mentecky

Posts: 321
Posted: 06/14/2009, 11:32 AM

joejac,

You're welcome. Glad it worked!

Rick
_________________
http://www.ccselite.com
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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