SPCascadeDropDown Edit Form Clears Secondary Value

Apr 27, 2010 at 3:01 PM
Marc, Just placed this onto a custom edit form and noticed that when the form loads, the secondary dropdown in the cascade list doesn't retain the initial value. Is there a workaround to make sure the initial value is placed back into the list on the loading of the drop down, or should I bind to another event? Chris Quick
Apr 27, 2010 at 3:04 PM

Here's my script:

<script type="text/javascript">
$(document).ready( function () {

	$().SPServices.SPCascadeDropdowns({
		relationshipList: "Subject Minor",
		relationshipListParentColumn: "Major",
		relationshipListChildColumn: "Title",
		parentColumn: "Major Category",
		childColumn: "Minor Category",
		debug: true
	});

});
</script>

Coordinator
Apr 27, 2010 at 3:05 PM
Edited Apr 27, 2010 at 3:09 PM

The function ought to preserve any existing settings.  In other words, if you go to the the edit form to work on an existing item, the dropdowns ought to all be set as they are in the item.  Once you start making changes, of course, the cascades may blank out the child values.

Can you tell me more about the situation?

M.

Apr 27, 2010 at 3:09 PM

Okay, standard issues list. Created a new edit form and set it as the default edit form for the issues list. When clicking on an issue to edit it, the first drop down shows correctly. The second (cascaded) drop down is empty, but the correct choices are populated. Both columns are lookup fields -- one is a custom list with no additional columns. The second (cascaded) list contains some additional data for workflow processing -- in this case, escalation rules and notification periods for open issues. This is running on WSS 3.0. I don't have access to central admin at the client, so I don't know if we're on SP2 yet -- based on some of the workflow behaviour, I'm guessing it is pre-SP2.

Coordinator
Apr 27, 2010 at 3:12 PM

Is it possible that you have data in the Subject Minor list which is causing this?  In other words, if you don't enforce the relationship in the NewForm, then when you get to the EditForm, the value you have in the Minor Category may not be allowable based on what is in the relationshipList.

M.

Apr 27, 2010 at 3:13 PM

As I was researching an unrelated problem, I discovered the issue. I changed the column being used to display the subject minor -- and of course, broke it. The new column name is Unique Name but I'm still referencing Title. Thanks for the quick response!

Coordinator
Apr 27, 2010 at 3:19 PM

No problem! Glad you spotted it.

M.

Jan 23, 2012 at 10:28 PM

Marc, I am experiencing this exact same issue except that my column names are all correct.  I am using SPServices 7.0 with JQuery 1.7.  The cascading works just fine, but the child column in the second relationship does not bind to the existing data in the EditForm.  I am using the exact same code in both the EditForm and the NewForm.

$(document).ready(function() {
	$().SPServices.SPCascadeDropdowns({
		relationshipList: "Integration Use Cases",
		relationshipListParentColumn: "Integration_x0020_Topic",
		relationshipListChildColumn: "Title",
		relationshipListSortColumn: "Use_x0020_Case_x0020_Num",
		parentColumn: "Integration Topic",
		childColumn: "Integration Use Case",
		simpleChild: true,
		debug: true
	});
});
	$(document).ready(function() {
		$().SPServices.SPCascadeDropdowns({
			relationshipList: "Integration Endpoints",
			relationshipListParentColumn: "Parent",
			relationshipListChildColumn: "Title",
			relationshipListSortColumn: "Endpoint_x0020_Num",
			parentColumn: "Integration Use Case",
			childColumn: "Integration Endpoint",
			simpleChild: true,
			debug: true
		});
	});

Jan 24, 2012 at 12:29 AM

$(document).ready(function only appears once in my code, not twice as in my previous post.

Jan 24, 2012 at 1:26 PM

Additional note:  I have discovered this morning that the problem goes away if I set simpleChild: false.  With simpleChild: true, the problem comes right back.

Jan 24, 2012 at 1:27 PM

Hello Paul,

please check the newest Alpha version which contains some significant work which has been done on the SPCascadeDropDown method. Please report if you got the same problems with the new version.

Jan 24, 2012 at 1:34 PM

I have confirmed that with jquery.SPServices-0.7.1ALPHA13.js the problem is resolved regardless of the value of then simpleChild parameter.   Thank you for the suggestion.

Coordinator
Jan 24, 2012 at 2:00 PM

Good to hear. I expect to get to beta with this new version soon. I'd appreciate any regression testing you might be able to do.

M.

Jan 24, 2012 at 9:14 PM

No problem, I will test with the beta when it is released.