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