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

Sep 1, 2015 at 11:28 AM
Edited Sep 1, 2015 at 11:34 AM
Hi,

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..
 $().SPServices.SPCascadeDropdowns({
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..
$().SPServices.SPSetMultiSelectSizes({
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
SP2013
SPservices version 2014.02
and jQuery v1.11.3
IE

Any clues on what may be happening?

Thanks,

Steve
Coordinator
Sep 1, 2015 at 7: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.

M.
Sep 2, 2015 at 3: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.

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