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 -> PHP

 get listbox value using update panel

Print topic Send  topic

Author Message
paulmason411


Posts: 127
Posted: 07/24/2008, 11:39 PM

Hi Guys,

Basically what I want to do is use ajax to change a listboxB when you alter listboxA. I know that this can be achieved using dependent listboxes however the listboxes I use are generated by custom code and not from a datasource.

This is what I have tried:

I added an update panel around listboxB and in the Refresh option I ticked the onchange for listboxA.

As a test I tried printing the value of listboxA with the following code:

print $Container->listboxA->GetValue();

The problem is that the value doesn't change when you select a different option from listboxA.

Any help or suggestions would be appreciated. Cheers.
_________________

http://paulmason.name - Web Development Blog

View profile  Send private message
wkempees


Posts: 1679
Posted: 07/25/2008, 2:17 AM

Just a quick remark:
The dependant listbox solution (especially CCT) will work on datasets as well as datasources.

The onchange action should generate a function of sorts, check code.
The function should have a parameter and return a parameter.
Test for that parameter not for $Container->listboxA->GetValue()

Walter
(not tested)

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
paulmason411


Posts: 127
Posted: 07/29/2008, 11:34 PM

I had a look and all I could find was some unfamiliar JavaScript that looked hard to edit.

To be more specific and hopefully break things down a bit more, I basically need to get the selected option id of listboxA without refreshing the page.

Any ideas?
_________________

http://paulmason.name - Web Development Blog

View profile  Send private message
maxhugen

Posts: 272
Posted: 07/30/2008, 7:12 PM

The Dependent Listbox feature creates an ajax service. This service CCS page is probably in a folder called services.

Open the service you created. It should have a Grid control in it. Open the grid's data source. This must have a WHERE predicate such as "WHERE myField = {keyword}". It should have been created for you when using the Builder.

The ajax javascript function will send a Request to something like:

"services/myService.php?keyword=myListboxA_Value"

You can insert an alert in the javascript, just before the Request line, to check the value of your keyword, to make sure the Request is sending the parameter you're expecting , ie, the value of ListboxA.

HTH
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.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.

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.