This topic is locked

Category control - error

7/19/2005 4:54:52 PM
ASPRunnerPro General questions
ngomong author

I love the new category control feature of v3.2
However, I'm having a problem.
When one lookup wizard field is chosen, I would like three other fields to become automatically populated. This works just fine if there is only one field to be populated, but with two or more, it does not.
Basically, what happens is, one of the fields will be populated correctly, but the others are simply blank. I have tried all manner of combinations, and I have tried to cascade the category control... Choosing Field A fills in Field B, which should fill in Field C, etc. But this does not work either.
Have you been able to obtain this behavior?
Thank you!

clay.

Sergey Kornilov admin 7/20/2005

Hi,
conditions:

Category field - is a category control,

ProductID field - is the first "master" Lookup field,

ProductID2, ProductID3, ProductID4 - other dependent Lookup fields.
Step 1. Open ..._aspfunctions.asp file and find the following code snippet:

if strName = "Category" then onchange = "onchange=""SetSelection('Category', 'ProductID', this.options[this.selectedIndex].value, '', arr_ProductID);""" end if


Add in onchange clause another three SetSelection calls replacing ProductID with ProductID2, ProductID3, ...
i.e. modify it this way:

if strName = "Category" then

onchange = "onchange=""SetSelection('Category', 'ProductID', this.options[this.selectedIndex].value, '', arrProductID);" &

"SetSelection('Category', 'ProductID2', this.options[this.selectedIndex].value, '', arrProductID2);" &

"SetSelection('Category', 'ProductID3', this.options[this.selectedIndex].value, '', arrProductID3);" &

"SetSelection('Category', 'ProductID4', this.options[this.selectedIndex].value, '', arr_ProductID4);"""

end if


Step 2. Open ..._edit.asp file and find the following code snippet:

SetSelection('Category', 'ProductID', '<%=rs("Category")%>', '<%=rs("ProductID")%>', arr_ProductID);


Duplicate it three times replacing ProductID with ProductID2, ProductID3, ...
i.e. modify it this way:

SetSelection('Category', 'ProductID', '<%=rs("Category")%>', '<%=rs("ProductID")%>', arr_ProductID);

SetSelection('Category', 'ProductID2', '<%=rs("Category")%>', '<%=rs("ProductID2")%>', arr_ProductID2);

SetSelection('Category', 'ProductID3', '<%=rs("Category")%>', '<%=rs("ProductID3")%>', arr_ProductID3);

SetSelection('Category', 'ProductID4', '<%=rs("Category")%>', '<%=rs("ProductID4")%>', arr_ProductID4);


Then repeat Step 1 and Step 2 for .._add.asp and ..._search.asp files.