SPCascadeDropdowns submitted values missing

Nov 12, 2009 at 8:55 PM

i've setup the SPCascadeDropdowns in my list's NewForm.aspx page and i have the display & filtering functioning as advertised.  This works nicely.  I do have 2 issues that i would like to bring to the group and hopefully get some quick resolution...first, some quick background on the list: I have created a Customer list and then a Location list which allows me to select a Customer from the 1st drop-down and the Location list is filtered based upon this selection.

1. The 2 lookup fields in my custom page are not getting saved upon the form submission.  If I go to the EditForm.aspx page (uncustomized) I am able to make the changes to the 2 drop-downs and the values are saved.  Am i missing some sort of configuration?  here is the code:

	$(document).ready(function(){
		$().SPServices.SPCascadeDropdowns({
			relationshipWebURL: "/sites/PVOP/VDR",		// [Optional] The name of the Web (site) which contains the relationships list
			relationshipList: "Sites",					// The name of the list which contains the parent/child relationships
			relationshipListParentColumn: "Customer",	// The internal name of the parent column in the relationship list
			relationshipListChildColumn: "Title",		// The internal name of the child column in the relationship list
			parentColumn: "Customer",					// The display name of the parent column in the form
			childColumn: "Site",						// The display name of the child column in the form
			debug: false								// If true, show error messages; if false, run silent
		});

I'm using the jquery.SPServices-0.4.5.js and jquery-1.3.2.js files.

2. The 2nd issue (minor) is the filtered drop-down requires a double click to select an option from the list.  The standard select only requires a single click.  is this something that i can modify?

Thanks for creating the jQuery Library.  I'm just getting started with using jQuery and it's helping me out!

Coordinator
Nov 13, 2009 at 11:47 AM

chart004:

The not getting saved issue is really worrisome, obviously.  I haven't has any other reports of this, and it *looks* like you are doing everything right.  Do you see any JavaScript errors?  Can you post the full structures of your lists? (Columns and their types)

The double click behavior ought to be the same with or without SPCascadeDropdowns.  Assuming you are using IE, it's due to the way that SharePoint renders the dropdown as a hybrid input/select control if there are 20+ items in the dropdown.

It's only helping you out if it works!  So let's get it working for you.

M.

Nov 13, 2009 at 1:45 PM
Edited Nov 13, 2009 at 2:09 PM

List Definitions

Customer

Column (click to edit) Type Required
Title Single line of text required
Created By Person or Group
Modified By Person or Group

Sites

Column (click to edit) Type Required
Title Single line of text required
Site Code Single line of text
Country Lookup
Customer Lookup
Address Single line of text
Address 2 Single line of text
Address 3 Single line of text
City Single line of text
State Lookup
Zip Single line of text
SiteNameCode Calculated (calculation based on other columns)
Created By Person or Group
Modified By Person or Group

Service Requests

Column (click to edit) Type Required
Requestor Name Single line of text required
Requestor Phone Single line of text
Phone Type Choice
Location Single line of text
Port Single line of text
Feed Single line of text
Cable Single line of text
Request Details Multiple lines of text required
Notes Multiple lines of text
System Used Choice
Scheduled Date Date and Time required
Vendor Name Choice
Customer Lookup
Site Lookup
Status Choice required
Priority Choice required
Ticket Number Single line of text
Created By Person or Group
Modified By Person or Group

 


I did have a workflow attached to the Service Requests list, however, I've removed this and i'm still experiencing the same behavior.

 

here is the full jQuery statements I've included in the NewForm.aspx page:

 

<script src="/Sites/PVOP/Site%20Collection%20Artifacts/scripts/jquery-1.3.2.js" language="javascript" type="text/javascript"></script>
<script src="/Sites/PVOP/Site%20Collection%20Artifacts/scripts/jquery.SPServices-0.4.5.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$().SPServices.SPCascadeDropdowns({
			relationshipWebURL: "/sites/PVOP/VDR",		// [Optional] The name of the Web (site) which contains the relationships list
			relationshipList: "Sites",					// The name of the list which contains the parent/child relationships
			relationshipListParentColumn: "Customer",	// The internal name of the parent column in the relationship list
			relationshipListChildColumn: "Title",		// The internal name of the child column in the relationship list
			parentColumn: "Customer",					// The display name of the parent column in the form
			childColumn: "Site",						// The display name of the child column in the form
			debug: false								// If true, show error messages; if false, run silent
		});
				
		$("input:[Title='Ticket Number']").attr("readonly",true);
		$("input:[Title='Ticket Number']").css('background-color','#e0e0e0');
	});
</script>

I should also mention that the NewForm.aspx page was customized to use the DataViewWebPart so that I could change the layout of the page.  If I remove DVWP and use the standard ListFormWebPart the contols functions as intended and the value is saved properly.  There must be something in the way the DVWP that is causing the issue...

-Chris

 


Coordinator
Nov 13, 2009 at 4:07 PM

Chris:

All certainly looks right.  If you remove the function call from your customized NewForm.aspx, are the values saved?  In other words, is it the conversion to the DVWP that's the problem, or is the jQuery doing it?

The jQuery ought to work fine as long as you are using the default controls for the columns.  That is, you haven't replaced any of the controls like this:

<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Title" ItemId="{@ID}" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}"/>

This is because the jQuery functions look on the page for controls that have a certain predictable structure.

The workflow you mention shouldn't have any impact on the jQuery; workflows run behind the scenes asynchronously.

M.