Home › Forums › Cascading dropdowns › Cascade Issue
Tagged: cascade
- This topic has 16 replies, 2 voices, and was last updated 3 years, 10 months ago by Alexander Bautz.
-
AuthorPosts
-
-
January 5, 2021 at 17:41 #32352
I have a cascade with 5 fields, using a simple 5 column list as the source. The fields in my destination list has all 5 fields setup as multiselect/plain text fields. I have checked all values in the source list and there are no hidden characters. I am seeing issues with the last 3 fields in the Edit form. It seems like it is comparing the value existing in the text field, including the ‘;'(delimiter) when comparing it to the values in the source list field. So both values appear in the right side ‘selected’ box, but I cannot remove the one with the ‘;’. And in the last field, it has a red box around it saying that the value is not valid. At a loss as to what is causing this. I have updated DFFS to the latest version as well.
Here is my JS:
spjs.casc.init(
{
“manualMode”:true,
“dataSource”:””,
“lookupList”:”regulatorcascades”,
“lookupListBaseUrl”:”{currentsite}”,
“lookupListFields”:[“Region”,”Country”,”Regulator”,”RegulatorShortName”,”LegalEntity”],
“thisListFields”:[“Region:multi”,”Country:multi”,”Regulator:multi”,”RegulatorShortName:multi”,”LegalEntity:multi”],
“setFields”:[],
“dropDownDefaultvalue”:””,
“filter”:””,
“hideEmptyDropdowns”:false,
“autoselectSingleOption”:true,
“clearInvalidSelection”:false,
“addOwnValue”:false,
“addOwnValueMouseover”:””,
“cancelOwnValueMouseover”:””,
“sideBySide”:true,
“multichoiceDelimiter”:”;”,
“debug”:true
}
);Attachments:
-
January 5, 2021 at 18:07 #32357
Just an update, if I set the autoselectSingleOption to False, everything seems to work. However, I need it to be set to True as the Short Name field I’d rather have auto-set behind the scenes and not visible on the form. It will always be a single value to select from.
-
January 5, 2021 at 20:21 #32371
Hi,
I haven’t tested it, but maybe you can try adding back the default multichoiceDelimiter including the \d (this will show each selection in a separate line when viewing in a list view or DispForm in a list item):"multichoiceDelimiter":";\d"
Alexander
-
January 5, 2021 at 20:34 #32373
Alexander, thank you for your quick reply! I just tried that and all it does is add the ‘;d’ to the end of the value, it doesn’t move it to another line. (see photo). This only seems to be happening for the last 3 fields where there is a single value. If I have multiple values selected for a field, it works.
Attachments:
-
January 5, 2021 at 21:42 #32376
Did you include the \ before the d like this?
";\d"
Alexander
-
January 5, 2021 at 22:48 #32378
Yes. I also set that on the New form, but it still shows the ‘;d’ at the end. Seems like if the only available value in the left pick box is selected and showing in the right selected box, then the issue happens. I’m sure it is something simple I am doing wrong, just can’t figure it out.
spjs.casc.init(
{
“manualMode”:true,
“dataSource”:””,
“lookupList”:”regulatorcascades”,
“lookupListBaseUrl”:”{currentsite}”,
“lookupListFields”:[“Region”,”Country”,”Regulator”,”RegulatorShortName”,”LegalEntity”],
“thisListFields”:[“Region:multi”,”Country:multi”,”Regulator:multi”,”RegulatorShortName:multi”,”LegalEntity:multi”],
“setFields”:[],
“dropDownDefaultvalue”:””,
“filter”:””,
“hideEmptyDropdowns”:false,
“autoselectSingleOption”:true,
“clearInvalidSelection”:false,
“addOwnValue”:false,
“addOwnValueMouseover”:””,
“cancelOwnValueMouseover”:””,
“sideBySide”:true,
“multichoiceDelimiter”:”;\d”,
“debug”:false
}
);Attachments:
-
January 5, 2021 at 22:50 #32382
Using SP 2013 and Windows 10, if that helps.
-
January 7, 2021 at 00:03 #32390
I’ll look into it tomorrow and see if I can recreate the issue.
Alexander
-
January 7, 2021 at 16:52 #32393
I’m not able to recreate this issue. Which browser are you using?
Also, please ensure the multiline text field is of type Plain text and not any kind of rich text.
Alexander
-
January 7, 2021 at 18:48 #32399
IE 11. All of the multi-line fields are plain text. I have tried it in IE 11 and Chrome with the same results. In the photos attached, it shows that when a single value is already in the selected field and there are no additional options to choose from, it causes the red box, which also removes all selected choices from the following field(even though there is a value in the multiline text field in the list itself, just not showing in the debug field).
If there are two values in the selected box, and no values left to select from, it seems to work as intended.
Attachments:
-
January 7, 2021 at 20:49 #32405
I figured it out – if you manually specify the delimiter the string “;\d” will not be properly interpreted as a semicolon with a linefeed. If you want to keep using the default delimiter just remove the multichoiceDelimiter parameter altogether from your function call – or change the delimiter like this:
"sideBySide": true, "multichoiceDelimiter": ";" + String.fromCharCode(13, 10), "debug": false
Alexander
-
January 8, 2021 at 14:52 #32412
I removed the delimiter line from the New and Edit forms and turned the “autoselectSingleOption”:true, back on for the Edit form. Now all of the boxes have the red outline and the ;d shows on the end of the values entered. I also tried it with your modified delimiter line. It also resulted in the same redline boxes and the ;d on the end of the values in the text boxes.
Attachments:
-
January 8, 2021 at 14:58 #32415
The values you have already selected and saved while the delimiter was wrong will cause this kind of error. For those records you must remove and re-select the values.
Does it work if you do that?
Alexander
-
January 8, 2021 at 15:25 #32417
I created new records to test this. It still can’t recognize the values compared to the source list due to the ;d on the end. Here is the debug from the Edit form.
[SPJS Cascading dropdowns v3.7.43] :: DEBUG
Function called with these arguments:
manualMode:true
dataSource:
lookupList:regulatorcascades
lookupListBaseUrl:/sites/coo-rr-009/emea-apac-ca-latam
lookupListFields:Region,Country,Regulator,RegulatorShortName,LegalEntity,Id
thisListFields:Region,Country,Regulator,RegulatorShortName,LegalEntity
setFields:
dropDownDefaultvalue:
filter:
hideEmptyDropdowns:false
autoselectSingleOption:false
clearInvalidSelection:false
addOwnValue:false
addOwnValueMouseover:
cancelOwnValueMouseover:
sideBySide:true
multichoiceDelimiter:;
debug:true
dataSourceId:regulatorcascades_061551076830822504
numberOfDropdowns:5
Populating this field
Region
Number of items returned
3
Populating this field
Country
Number of items returned
0
*** Please note that this debug panel cannot determin if the fieldname: “Country” in the lookup list is correct.
*** If you are not getting the options you expected, verify the FieldInternalName: “Country” in the lookup list: “regulatorcascades”
Populating this field
Regulator
Number of items returned
0
*** Please note that this debug panel cannot determin if the fieldname: “Regulator” in the lookup list is correct.
*** If you are not getting the options you expected, verify the FieldInternalName: “Regulator” in the lookup list: “regulatorcascades”
Populating this field
RegulatorShortName
Number of items returned
0
*** Please note that this debug panel cannot determin if the fieldname: “RegulatorShortName” in the lookup list is correct.
*** If you are not getting the options you expected, verify the FieldInternalName: “RegulatorShortName” in the lookup list: “regulatorcascades”
Populating this field
LegalEntity
Number of items returned
0
*** Please note that this debug panel cannot determin if the fieldname: “LegalEntity” in the lookup list is correct.
*** If you are not getting the options you expected, verify the FieldInternalName: “LegalEntity” in the lookup list: “regulatorcascades”
-
January 8, 2021 at 15:35 #32419
If you have multiple different cascading dropdowns configured you must remove the multichoiceDelimiter parameter from all of them because I didn’t make this a per-instance setting so if you use it in one it will override the delimiter in all instances in the same form.
Alexander
-
January 8, 2021 at 16:53 #32423
OK, I have two different cascading dropdown groups on my Edit form. I have removed the delimiter line from the code in both. Created a new record (autoselectSingleOption set to true on the New form). Values populate correctly in the text fields with the ; as the delimiter.
If I set the autoselectSingleOption to false on the Edit form, it recognizes the entries and no red boxes.
However, if I set autoselectSingleOption to true, and if there is only one option available and it has been selected, the red box appears around the empty selector box and it displays both the value with the ; and the one without it in the selected box, similar to how it has failed previously.
I alos tried it with the “multichoiceDelimiter”: “;” + String.fromCharCode(13, 10), line added into all four places (New and Edit forms) but with the same results.
-
January 8, 2021 at 18:51 #32425
I’ll look into it some more over the weekend, but if you could email me a few screenshots of your datasource (just a few items) and any other relevant info so I can recreate the same dataset and setup as you are using it would be great (just email it to the address you get the forum notifications from).
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.