Cannot SPCascadeDropDowns to work with accented characters

Sep 15, 2015 at 7:14 PM
Edited Sep 15, 2015 at 7:15 PM
A client is using AlphaMosaik Oceanik translation module with SharePoint 2013 Entreprise server and I cannot seem to figure out how to code the SPCascadeDropDowns script it to work with French.

I tried replacing the accented characters with Unicode equivalents but that doesn't seem to work.

The end result is that each dropdown doesn't filter the next and it returns with both English and French options.

The following is a code snippet:

$(document).ready(function() {
    var lang = $('html').attr('lang');

    //if (lang == 'en-US'){
        $().SPServices.SPCascadeDropdowns({
            relationshipList: "Request Details",
            relationshipListParentColumn: "Request_x0020_Type",
            relationshipListChildColumn: "Title",
            relationshipListSortColumn: "Title",
            parentColumn: "Request Type",
            childColumn: "Request Detail",
            matchOnId: true
        });

        $().SPServices.SPCascadeDropdowns({
            relationshipList: "Request Options",
            relationshipListParentColumn: "Request_x0020_Detail",
            relationshipListChildColumn: "Title",
            relationshipListSortColumn: "Title",
            parentColumn: "Request Detail",
            childColumn: "Request Option",
            matchOnId: true
        });

    //} else {
        //alert(lang);  
    $().SPServices.SPCascadeDropdowns({
            relationshipList: "D\u00e9tails de la requ\u00eate",
            relationshipListParentColumn: "Request_x0020_Type",
            relationshipListChildColumn: "Titre",
            relationshipListSortColumn: "Titre",
            parentColumn: "Type de requ\u00eate",
            childColumn: "D\u00e9tail de la requ\u00eate",
            matchOnId: true
        });

        $().SPServices.SPCascadeDropdowns({
            relationshipList: "Options de la requ\u00eate",
            relationshipListParentColumn: "Request_x0020_Detail",
            relationshipListChildColumn: "Titre",
            relationshipListSortColumn: "Titre",
            parentColumn: "D\u00e9tail de la requ\u00eate", 
            childColumn: "Option de la requ\u00eate",
            matchOnId: true
        });

    /}
});
Sep 17, 2015 at 8:53 AM
Edited Sep 17, 2015 at 12:45 PM
Hello,

Have you tried to use the columns' internal names ?

"Détails de la requête", for example, has the following internal name : "D_x00e9_tail_x0020_de_x0020_la_x" (internal names are limited to 32 characters)

I'm french too, and whenever special characters are involved, i usually switch to internal names to avoid strange issues.
Sep 17, 2015 at 11:54 AM
How would I find the internal name in French

Sent from my iPhone

Sep 17, 2015 at 12:55 PM
You have several solutions, some of them are described here : http://techtrainingnotes.blogspot.fr/2012/10/sharepointfinding-column-display-and.html

I usually use the first one, and another that is not listed is to use the brower inspect/examine tool on a column name in a list view (a bit tricky sometime with the right mouse button calling the sort/filter menu).
Sep 17, 2015 at 12:57 PM
Thanks I will take a look

Sent from my iPhone

Coordinator
Sep 17, 2015 at 1:43 PM
Note that the function wants InternalName for the relationshipList columns, but the DisplayName for the current list columns.

Yes, the way SharePoint encodes InternalNames can be exasperating.

M.
Sep 17, 2015 at 4:35 PM

The internal names are all in English.

The display names, when French is enabled, are in French.

When the page loads, the javascript is somehow converted. I tried to use the original accents in the javascript but that got replaced with squares after the page was loaded. Perhaps its being converted by the Oceanik module that does the translation. So I tried to replace the accents in the javascript/jquery with Unicode version of the accent (eg. \u00ea) but that still did not work

If I just leave the code for English in place (without the French code block), then when French is enabled, the dropdowns work but the result would be the following:

Request Types Dropdown list (displays in French)

Request Details Dropdown list (displays in English, only when a Request Type above is selected)

Request Options Dropdown list (displays in English, only when a Request Detail above is selected)


Sep 17, 2015 at 5:52 PM
How have you code it in the past, where you have more than 1 language? Is it the same code or do you have to translate the other languages for the script to run.

As it is now, if I leave the English version in, then when French is enabled, then the dropdowns are still in English and not translated. If you looked at the source of the page you would see all of the options translated except the jquery cascaded dropdowns would still be in English.
Coordinator
Sep 17, 2015 at 7:37 PM
It sounds like you have some sort of auto translation going on with Oceanik? I've never heard of that.

In order to know which items to show upon cascade, SPServices looks at the values in the relationshipList and reloads them using AJAX. The content will be whatever is stored in the relationshipList. I have no idea what impact Oceanik might have.

M.