SPServices.SPCascadeDropDowns - both parent & child fields are site columns from the root folder and I'm working on a subsite.

Aug 16, 2011 at 11:15 PM

I know I sound like an utter idiot. Anyone who responds is in my debt.

I use custom list forms. I do not use CAML or such to build the drop-downs - just the basic built-in SPD 2007 stuff. The list I'm working with is on a subsite we shall refer to as "SubsiteA".

So, I have two fields on my SubsiteA that I use on the "newform.aspx" and "editform.aspx" pages (again, this is a custom list form - I kept the original ones - just renamed them. I may be dumb but I'm not that dumb).

  • District, which is the parent field. Same for static & display, which is a lookup to another list, called "LKP_District", pulling from a field called "Name". This other list is on the root, and I am pulling it into the subsite list as a site column.
  • Association%5FCode, which is the child field. Obviously, this is the static name (I didn't create this column and changing it now would be a logistical nightmare). The display name is "Association Code". This is a lookup to another list, called "LKP_AssociationCode" pulling from the "Association_Code" field (I was able to get my way on that at least). This child list contains the District in a field called "District_Name". This list is on the root, and I am pulling it into the list as a site column.

Can I even have these cascade, since both are lookups to other lists on the root and I'm pulling them in as site columns? 

 

Coordinator
Aug 17, 2011 at 12:11 AM

Nerak:

I think that SPCascadeDropdiowns will work for you based on what you describe. You can specify the relationshipList and the relationshipWebURL, which should allow you to pull the items from the lists in the root site in the Site Collection.

M.

Aug 17, 2011 at 3:02 PM

I'm doing something wrong. I changed the fields (by deleting & recreating them) so their internal names are "District" & "AssociationCode". I also double-checked, and the list is actually "LKP_Assocation_Code", not what I said above. I even have "debug" on, and nothing is happening. Help!

 

        $().SPServices.SPCascadeDropdowns({
              relationshipWebURL: "../../../Lists",
              relationshipList: "LKP_Association_Code",
              relationshipListParentColumn: "District",
              relationshipListChildColumn: "AssociationCode",
              parentColumn: "District",
              childColumn: "Association Code",
              debug: true
          });

 

Coordinator
Aug 17, 2011 at 3:47 PM

Your relationshipWebURL isn't pointing to a site, which is probably the issue. It should be something like "/Projects".

M.

Aug 17, 2011 at 5:14 PM

The site that has the form that needs the drop downs is a subsite.

Link to the child list: http://sharepointXX/sites/XXX/YYY/Lists/LKP_Association_Code

Link to the subsite: http://sharepointXX/sites/XXX/YYY/SubsiteName/Lists/ContractMgmt <-- this is where the form is that 'needs' the cascading style sheets. So, shouldn't the path be "../../../Lists"? Or do I leave off the "Lists"?

I changed it to this, and still no love :(

$().SPServices.SPCascadeDropdowns({
              relationshipWebURL: "../../YYY",
              relationshipList: "LKP_Association_Code",
              relationshipListParentColumn: "District",
              relationshipListChildColumn: "AssociationCode",
              parentColumn: "District",
              childColumn: "Association Code",
              simpleChild: true,
              debug: true
          });      

 

I really appreciate your help with this.

 

Coordinator
Aug 17, 2011 at 11:27 PM

The relationshipWebURL must point to the site where the relationshipList lives. So it needs to be something like:

 relationshipWebURL: "/sites/XXX/YYY",

SPServices doesn't handle relative paths like the one you tried.

If the relationshipList lives in the current site, then there is no need to specify the relationshipWebURL. All of this is explained in the docs.

M.