Selections from Multiple SPCascadeDropdowns per form not being saved (SP2013)

Sep 1, 2015 at 12:28 PM
Edited Sep 1, 2015 at 12:34 PM

I have two SPCascadeDropdowns functions on the same form (Editform), but the selections from the first one are never saved.

The call is in a very basic format..
relationshipList: "<title>",
relationshipListParentColumn: "<col>",
relationshipListChildColumn: "<col>",
parentColumn: "<col>",
childColumn: "<col>",
debug: true
The two columns are set up to be multivalued look ups.

Both functions work well in that they present the correct cascade values. However, on save, only the selected values from the second lookup are stored.

I have put a breakpoint in a presaveaction function, and put in some jquery to see what was in the two variables. The first variable had a repeating value of <nnn>#;<text>, with all the correctly selected options. The second one had a repeating value of <nnn>|t<text>, with all the correctly selected options.

I suspect that the value was not stored as it was not in the correct format (the one with the #; format was not stored). I will add some jquery to reformat the string, and see if that makes any difference.

I also added in two commands SPSetMultiSelectSizes for each of the drop downs
i.e. like..
multiSelectColumn: "Web Service Operation"
Selection boxes for the first one appeared extremely small (3 characters wide) and the boxes for the second drop down were extremely large (?500 characters wide), so it seems that the SPSetMultiSelectSizes function is having a similar problem in being able to process the #; delimiters versus the |t delimiters

Config is
SPservices version 2014.02
and jQuery v1.11.3

Any clues on what may be happening?


Sep 1, 2015 at 8:45 PM
Is the first column a standard lookup column or something else? There are some third party lookup column types out there and SPServices won't understand them. It seems as though this may be the case, since the values aren't formatted the way we'd expect.

The other thing I'd check is whether your list is structured the way SPServices wants it to be.

Sep 2, 2015 at 4:15 AM
Thanks for that encouragement to look further.

The problem appeared to be caused by the way that the column was defined with the multivalue lookup in the list, and that this lookup definition was not the same as the lookup table being used within the SPCascadeDropdowns call.

What appears to happen is that the edit form processes the selections as token elements, so if item 1 & 3 were selected, then when the list was displayed, it listed item 1 and 3 of the different lookup list.

Once the two were put into sync, then the |t characters were replaced with the standard #; symbols.

All is working well now.

The problem with the call to SPSetMultiSelectSizes is also resolved. This routine only appeared to work as required if I placed the call AFTER the call SPCascadeDropdowns. (This contradicted the information in the doco for the SPSetMultiSelectSizes function that was on this website).

All good stuff. Thanks for all your help, and keep up the great work.

Marked as answer by southskies on 9/1/2015 at 8:15 PM