CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 geeting additional table values from dependent list box

Print topic Send  topic

Author Message
bas60

Posts: 18
Posted: 05/17/2011, 2:11 AM

I have created a simple Dependent list box using feature builder

Tables simple Category & Pages

First I created a Record with Two droplists
Then used feature builder - Dependant List box

This work fine - I can select the category and only the pages in that category show up

I now need TWO other values from the Pages table (image1 & image2) - how can I do that ??

I tried messing with CCDLookup but not sure how to get the PageID of the selected Page

can anyone point me in the right direction?

View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 07/29/2011, 10:39 AM

bas60,

Have you figured this out or do you still need assistance with this request?
View profile  Send private message
tfertil

Posts: 43
Posted: 07/29/2011, 1:17 PM

Hi bas60:

As I understand, you need to set the value of more than one control using only a "master" listbox.

If this is it, the simplest but less efficient way is to create two more dependent list boxes using the feature builder, setting the same master listox. But this involves separate database access for each of your list boxes, so depending on the volume of records you must read for each one, your page will be slower.

Another way is to mess with the ajax code.

a. Go to the service page (the one created by the wizard) and you will find a record you can select to examin the SQL query used. Be sure all the columns you need are selected.

b. In the JavaScript code for your dependent list box you will find an assigment like this:

  
            for (var i = 0; i < valueRows.length; i++) {  
                var newOption = new Option(valueRows["1"], valueRows["0"]);  
                dependentElement.options[dependentElement.options.length] = newOption;  
            }   

Here you can add assignments for other elements.

valueRows[0] is the first column of your dataset, [1] is the second column, and so on.

So lets say you need to assign the value in the third column of your dataset to another listbox of name dul_lineProductTemp (extra tip: it could be any type of control: textbox, listbox, etc.)

You add a line like this:

  
            for (var i = 0; i < valueRows.length; i++) {  
                var newOption = new Option(valueRows["1"], valueRows["0"]);  
                dependentElement.options[dependentElement.options.length] = newOption;  
                getSameLevelCtl("dul_lineProductTemp", sender).value = valuesRow[2];  
            }   

Let me know if this puts you in the right direction
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.