SPCascadeDropdowns not showing all my childColumn values

Mar 18, 2010 at 9:51 PM

Hello,

Thank you for the great library. I'm having a bit of trouble and was hoping run my scenario by the community to get around this stumbling block. I'm attempting to create something I think is possible based on the documentation but I'm not seeing all my child column values. Here is my setup:

  1. Products list.
  2. Functionality list.
  3. Issues list.
  4. Symptom List.

The symptom list will contain lookups to the other lists via site columns. The idea here is that a user will have a symptom they want to report. They'll go to the symptom list and will select a product. This product will be bound to multiple chunks of functionality and it's up to the user to pick a single item that makes sense. The Issue List will be added to the symptom list via a site column that is a lookup. This issues list is static and requires nothing special. It could have been part of this list but this way it can be reused more efficiently.

Take for example SPD 2007, it is a product and the functionality it has is a one to many relationship. Think: data view, workflow, css and so forth.

That is the part I'm having an issue. I've populated the products list with some data, again let's keep with something we're all familiar with, WSS 3.0, SPD2007, MOSS2007 and so forth. These values are stored in the title column.

Next, the functionality list is populated with data such as asp.net controls, CSS, workflows and so forth. On the products list, I consume the functionality list by adding an existing site column which is a lookup to the functionality list and it allows for selecting multiple values. I can bind my single product to multiple chunks of functionality establishing a one to many relationship.

A list item in the products list will look something like this: SPD2007 > Asp.net, CSS, Data view, workflow. This can be done for various products.

Back to the symptom list which is the glue that binds this whole thing. The OOB listformwebpart is being used to create the symptoms. A few existing columns are added: Products, Functionality, Issue which all point back to the original lists.

I think this is where I'm doing something wrong. I created a new site column of the lookup variety and pointed it to the functionality list this way I'm not reusing the one that already exists which allows for multiple items.

This is what my markup looks like:

<script language="javascript" type="text/javascript" src="../../JqueryLib/jquery.js"></script>
<script language="javascript" type="text/javascript" src="../../JqueryLib/spservice.js"></script>
<script language="javascript" type="text/javascript">
 $(document).ready(function() {
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "Products",
   relationshipListParentColumn: "Title",
   relationshipListChildColumn: "FunctionalityLookupSiteColumn",
   parentColumn: "ProductsLookupSiteColumn",
   childColumn: "FunctionalityLookupSiteColumn2",
   debug: true
  });
 });
</script>

With this code I can select a drop down which contains all the products and I get only 1 of the multiple values stored in the child column.

In my example list item from the products list (SPD2007 > Asp.net, CSS, Data view, workflow) I only see asp.net but not CSS, Data view or workflow.

I think I'm just structuring my list incorrectly but I cannot think of a way to make this cleaner.

Regards,

Rob

Coordinator
Mar 18, 2010 at 10:00 PM

Lots of words, Rob!

If I parse all this right, the issue may be the multiple values in your relationshipList (Products). SPCascadeDropdowns wants lists without multi-select columns.  If you look at the example I give on the documentation page ($().SPServices.SPCascadeDropdowns) with Countries, Regions, and States, perhaps it will be clearer.

M.

Mar 18, 2010 at 10:12 PM

Thank you very much for the prompt reply. I figured since you mentioned GIGO a few times in your other posts that I would give you a good write up of what I'm doing :). The bottom line here seems that I misunderstood the available functionality. The multiple values option will not work.

The reason I did it this way was when I created multiple products to map to each symptom I got repeats in my product drop down.

Back to the drawing boards! Again, thank you very much.

Coordinator
Mar 18, 2010 at 10:23 PM

I'm happy to help. Sorry if I sounded dismissive.

Can you post some of your data here? Alternatively, ping me through the contact form by clicking on my "handle" and we can exchange stuff in email.

M.

Mar 18, 2010 at 10:29 PM

No worries. I didn't take it that way at all. I guess the question is: Can SPCascadeDropdowns function against a reference list that has a one to many relationship. Meaning a single list item can have multiple child values.

Regards,
Rob

Coordinator
Mar 18, 2010 at 11:07 PM
Edited Mar 19, 2010 at 12:52 AM

A parent can absolutely have multiple children; that's sort of the point of the whole thing.  But the list constructs probably need to be different than what you've got. So, for example, each item in your Products list should have [at least] two columns: Function and Product.

Func1   ProdA
Func2   ProdA
Func3   ProdA
Func1   ProdB
Func4   ProdB
Func5   ProdB

etc.

So no multi-select values, one item per relationship.

M.

Mar 19, 2010 at 12:34 AM
Edited Mar 19, 2010 at 12:53 AM

Perfect, thank you very much. I saw the light after that clarification. My current list called Products is now a functional relationship list. I created a new list called AllProducts and created a lookup to it with the site lookup column and everything is great.

Thanks again Marc.

Coordinator
Mar 21, 2010 at 2:27 PM

Awesome. Glad you got it worked out. Let me know if you need anything else.

M.