Does SPCascadeDropdowns work against Doc Libraries?

Nov 19, 2009 at 11:12 PM

I have tested and can't seem to get the SPCascadeDropdowns to work against columns/fields in a Document Library as opposed to a list. Can this be done?

Coordinator
Nov 20, 2009 at 1:07 AM

la:

A list is a list is a list, and yes, SPCascadeDropdowns should work on a Document Library's EditForm.aspx.  Let me know how I can help you get it up and running.

M.

Nov 20, 2009 at 1:39 AM

I sadly admit to temporary insanity. After posting my question knowing the answer but needing a sanity check, I found my error. The parent list comment does not specify to use the display name so I was using the internal list name which obviously was incorrect.

Sent from my mobile device.

Regards,
Allan Walker


From: sympmarc <notifications@codeplex.com>
To: Walker, Allan
Sent: Thu Nov 19 21:07:39 2009
Subject: Re: Does SPCascadeDropdowns work against Doc Libraries? [SPServices:75662]

From: sympmarc

la:

A list is a list is a list, and yes, SPCascadeDropdowns should work on a Document Library's EditForm.aspx. Let me know how I can help you get it up and running.

M.

Coordinator
Nov 20, 2009 at 1:41 AM

We all have temporary insanity from time to time.  No problem.

I hope you get it working, and if not, post back: I'm here to help!

M.

Nov 20, 2009 at 12:55 PM

I do have another question if it is not too much to ask for. I am trying to refine my query using the CAMLQuery param. The documentation indicates that it will add an AND and then insert so my assumption was if my query looks like this in whole:

<Query>

   <Where>

        <Neq>

            <FieldRef Name='Depleted' />

            <Value Type='Calculated'>1</Value>

         </Neq>

   </Where>

</Query>

<ViewFields>

   <FieldRef Name='VendorNameLU' />

   <FieldRef Name='PONum' />

</ViewFields>

<QueryOptions />

Then I should only put

        <Neq>

            <FieldRef Name='Depleted' />

            <Value Type='Calculated'>1</Value>

         </Neq>

As the CAMLQuery value. Looking at the code, it seems to actually build that query as

<Query>

   <Where>

      <And>

         <Neq>

            <FieldRef Name='Depleted' />

            <Value Type='Calculated'>1</Value>

         </Neq>

      </And>

   </Where>

</Query>

<ViewFields>

   <FieldRef Name='VendorNameLU' />

   <FieldRef Name='PONum' />

</ViewFields>

<QueryOptions />

Which with the AND does not work. Am I doing this incorrectly?

From: sympmarc [mailto:notifications@codeplex.com]
Sent: Thursday, November 19, 2009 9:42 PM
To: Walker, Allan
Subject: Re: Does SPCascadeDropdowns work against Doc Libraries? [SPServices:75662]

From: sympmarc

We all have temporary insanity from time to time. No problem.

I hope you get it working, and if not, post back: I'm here to help!

M.

Read the full discussion online.

To add a post to this discussion, reply to this email (SPServices@discussions.codeplex.com)

To start a new discussion for this project, email SPServices@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Coordinator
Nov 20, 2009 at 1:58 PM

Allan:

The query is actually built up like this in SPCascadeDropdowns:

var camlQuery = "<Query><Where>";
if(opt.CAMLQuery.length > 0) camlQuery += "<And>";
camlQuery += "<Eq><FieldRef Name='" + opt.relationshipListParentColumn + "'/><Value Type='Text'>" + parentSelectSelected + "</Value></Eq>";
if(opt.CAMLQuery.length > 0) camlQuery += opt.CAMLQuery + "</And>";
camlQuery += "</Where></Query>";

I'm filtering in the bolded line based on the selected value in the parentColumn.  If you specify a CAML fragment for CAMLQuery, it's <And>ed with that filter.

Make sense?

M.

Nov 20, 2009 at 2:05 PM

Ahhh (as the lightbulb comes on). I see. I will refine my CAML and test again when I get out of the Dr.

Sent from my mobile device.

Regards,
Allan Walker


From: sympmarc <notifications@codeplex.com>
To: Walker, Allan
Sent: Fri Nov 20 09:58:59 2009
Subject: Re: Does SPCascadeDropdowns work against Doc Libraries? [SPServices:75662]

From: sympmarc

Allan:

The query is actually built up like this in SPCascadeDropdowns:

var camlQuery = "<Query><Where>";
if(opt.CAMLQuery.length > 0) camlQuery += "<And>";
camlQuery += "<Eq><FieldRef Name='" + opt.relationshipListParentColumn + "'/><Value Type='Text'>" + parentSelectSelected + "</Value></Eq>";
if(opt.CAMLQuery.length > 0) camlQuery += opt.CAMLQuery + "</And>";
camlQuery += "</Where></Query>";

I'm filtering in the bolded line based on the selected value in the parentColumn. If you specify a CAML fragment for CAMLQuery, it's <And>ed with that filter.

Make sense?

M.