Cascaded Dropdown and People Picker Issue

Coordinator
Aug 11, 2014 at 6:10 PM
From lpvijay in the Issues Tracker
https://spservices.codeplex.com/workitem/10274


Hi,
I'm using the SPServices.SPCascadeDropdowns functionality in my custom list which is perfectly working fine. I've used it for both the new and edit forms of the list and works well in both.

Recently I added a User/Group field to this list. Now in both the new and edit forms, though the cascaded dropdown works fine, I'm unable to resolve the persons name when I type in the picker. The default name resolver button that comes with the people picker is not resolving the user name and the same is the case with Ctrl+K. Thankfully the address book button still works and I can choose the person.

With the CascadeDropdown function removed in my script, I'm able to resolve the user name thru both methods. Is there any way I can have both the cascade dropdown and the user name resolver working together.

I've tried with an old version(jquery.SPServices-0.5.1.min.js) and also the new version jquery.SPServices-2014.01.min.js. But both show the same behaviour. Tested on IE 10 & IE 11. No luck though.

BTW, the farm was upgraded to SP2 sometime back and stands at 14.0.7123.5000. I'm not sure how it would've behaved before the upgrade, since I had the issue of the "RequiredFields" immediately after upgrading :) I don't know if this has creped in after the upgrade.

Thanks,
Aug 12, 2014 at 1:02 PM
Edited Aug 12, 2014 at 1:04 PM
Hi Marc,

Since I couldn't find option to add attachment here, I've uploaded a CDDSite.wsp in the original issue at Cascaded Dropdown and People Picker Issue .

The attached wsp file is an export-web of the site that I'm working on. It is based on Blank Site template and is a scaled-down version of the actual site I'm working on.

The site has SalesList which has lookups to the States and Cities list. The New Form and Edit Form for the SalesList has a CEWP which contains the javascript configuration for cascaded dropdowns. If you're importing this web, you may need to change the references in the script to point to correct locations. The spservices and jquery libraries are present in the JSLibrary.

For quick reference, here is the code that I'm using in the CEWP for SalesList's New and Edit Forms
<script type="text/javascript" language="javascript" src="/CDDSite/JSLibrary/jquery-1.4.min.js"></script>
<script type="text/javascript" language="javascript" src="/CDDSite/JSLibrary/jquery.SPServices-2014.01.min.js"></script>
<script type="text/javascript" language="javascript">

$(document).ready(function() 
{
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "Cities",
   relationshipListParentColumn: "State",
   relationshipListChildColumn: "Title",
   parentColumn: "State Required Field",
   childColumn: "City Required Field",
   promptText:"None",
   debug: false
  }); 

});
</script>
In the SalesList, where the cascaded dropdowns are required, the State and City columns are mandatory. I've observed, that if the columns are optional and the script changed accordingly, then the user name resolver of people picker works. If it is made mandatory, then it wouldn't. I guess it is a problem that has crept in after SP2 upgrade.

Hope the wsp can be used and is of some help.

Thanks,
Coordinator
Aug 12, 2014 at 3:20 PM
A couple of things:
  • You're using a pretty old version of jQuery. I'd suggest upgrading to 1.11.1.
  • You shouldn't specify the column title with the " Required Field" suffix. 2014.01 handles that for you.
  • promptText will cause you problems with a required column, and I deprecated it long ago.
Try this:
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "Cities",
   relationshipListParentColumn: "State",
   relationshipListChildColumn: "Title",
   parentColumn: "State",
   childColumn: "City"
  }); 
M.
Aug 13, 2014 at 6:25 AM
Hi Marc,
Thanks for your quick response. The CEWP code, the way it stands as of now is as below. With the " Required Field" suffix removed, the cascaded dropdown functionality itself has stopped working, though the name resolver and Ctrl+K works now on the people picker.
<script language="javascript" type="text/javascript" src="/CDDSite/JSLibrary/jquery-1.11.1.min.js"></script>
<script language="javascript" type="text/javascript" src="/CDDSite/JSLibrary/jquery.SPServices-2014.01.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() 
{
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "Cities",
   relationshipListParentColumn: "State",
   relationshipListChildColumn: "Title",
   parentColumn: "State",
   childColumn: "City",
  }); 
});
</script>
Anything else I need to change here?

Thanks for your help,
Coordinator
Aug 13, 2014 at 12:53 PM
You have a dangling comma after childColumn. Removing that might do it.

M.
Aug 14, 2014 at 6:46 AM
Argh!! My Bad!!!! But sorry Marc, even with the trailing comma removed, I can't get the cascaded dropdowns to work. I can only get it working if the " Required Field" suffix is added, but compromises the name resolver. Anything else that comes to your mind?

Thanks
Coordinator
Aug 14, 2014 at 4:15 PM
I think this will require some debugging for me to help. If it's a bug in SPServices, I want to fix it, but I haven't heard any other reports of this.

Any chance you could to a screen share with me so that I can see what's happening?

M.
Aug 18, 2014 at 1:51 PM
I can not get cascading to work on O365 without 'Required Field' with 2014.1.
Coordinator
Aug 18, 2014 at 4:31 PM
regularroutine:

What happens when you try? Do you get any script errors? Do you see any changed behavior at all from the default out of the box behavior?

M.
Aug 19, 2014 at 8:49 AM
I get the following error:
Unhandled exception at line 21, column 30428 in https://xx.sharepoint.com/sites/zz/yy/scripts/jquery.SPServices-2014.01.min.js

0x800a138f - JavaScript runtime error: Unable to get property 'push' of undefined or null reference
Aug 19, 2014 at 11:49 AM
Sorry Marc, I'd not be able to get a screen-sharing session owing to the work environment. But the attached wsp in the original issue at Cascaded Dropdown and People Picker Issue has the same problem. You just'd have to import this web into a test site collection on SP2010 where you can see the problem. Hope this helps.

Thanks for your help.
Regards,
Aug 19, 2014 at 12:37 PM
Marc, when using 2.1.1 jQuery I no longer get the error when not having the Required Field text but it still doesnt work, the text has to be there for it to work.

Sidenote, I also have the same issue as the person in the below thread on 0365:
https://spservices.codeplex.com/discussions/529210
Coordinator
Aug 19, 2014 at 10:18 PM
Edited Aug 19, 2014 at 10:18 PM
Which issue is that, regularroutine? Also, can you tell me more about your environment? Office365, SPServices 2014.01, and what about the columns?

M.