SPCascadeDropdowns - Items within folders

Jan 18, 2013 at 1:44 PM

First of all thank you to everyone who's contributed to SPServices.. Its a seriously cool addition to SharePoint.

Anyway I have an issue with SPCascadeDropdowns on a Project task lists that contains list items within folders.  The problem being only folders are being retrieved and added to the lookup (Items within folders are ignored).

Is there something I'm doing wrong ?

Coordinator
Jan 18, 2013 at 3:10 PM

No, you're not doing anything wrong.

I'm not sure that anyone has ever had this issue before, at least I can't recall anyone ever asking that SPCascadeDropdowns work with items in folders. Usually lookup sources are in flat lists. Can you outline a bit more about what you are trying to accomplish?

M.

Jan 18, 2013 at 3:19 PM
Edited Jan 18, 2013 at 3:20 PM

I can't say this is certain but it may be that the default view on the source list is a view that includes folders.  I seem to recall running into this myself.  When the function runs to populate the child dropdown, I believe it performs a GetListItems operation based on the default view of that source list.  What I did to overcome that was to create a flat view of my source list with the option "Show all items without folders."  I made that the default view for the source list.

Geoff

Coordinator
Jan 18, 2013 at 3:39 PM

Geoff:

That may indeed work. However, because I'm passing in different filtering parameters than the default view has, the default view is effectively overridden.

Knowing more about the goals will help.

M.

Jan 18, 2013 at 5:39 PM

Couldn't you just pass in a    <QueryOptions>ViewAttributes Scope='RecursiveAll' /></QueryOptions> bit of CAML in the CAMLQuery option to do a recursive lookup?

Jan 20, 2013 at 8:59 AM

Sorry for taking a while to reply, I got to see snow for the first time in five years this weekend...

Anyway a default view showing all files did the trick!  Thank you.

Just in case it helps, the reason for this is to create a project management site.  Being the Gant view for project tasks doesn't seem to allow web part connections or parameters, each project has its own folder.  I then make use of the RootFolder query string to create items in the correct folder, same again I use RootFolder for displaying only the current projects tasks.   I then wanted a cascading lookup to show only the current projects summary tasks within a drop down.

Its nearly working a treat, I just need to add an additional CAML query to show only the Summary Task content type..  So thanks again to everyone.