This project has moved. For the latest updates, please go here.
1

Closed

SPComplexToSimpleDropdown - required fields get renamed without the 'Required Field' appended to the field name

description

Hi Marc,

Hi Marc,

I believe I've found another instance in which the Office 365 Update Changes ‘Display Name’ on Required Fields issue is causing a problem, this time on the SPComplexToSimpleDropdown function.

When using this function on a required field, both the new simple dropdown and the hidden complex dropdown get created with the field's name, but without 'Required Field' appended to the end. So if my complex field starts as "Deal Required Field", the two resulting dropdowns have the Title set as "Deal".

Where this becomes a problem is when dealing with multiple browsers. Since the function is smart enough to do nothing if the dropdown isn't complex, the field winds up with an inconsistent name. IE will have the field as "Deal", but Chrome will have it as "Deal Required Field". This is an issue if you later need to refer to this field with jQuery or something similar.

Thanks!
John Riganati
Closed Dec 16, 2014 at 5:34 PM by sympmarc
Fixed/deployed in 2014.02

comments

sympmarc wrote Jun 2, 2014 at 1:44 PM

Actually, the function is supposed to be smart enough to do nothing:
    // If we don't have a complex dropdown, then there is nothing to do
    if (columnSelect.Type !== dropdownType.complex) {
        return;
    }
Can you give me some more info?

M.

jriganati wrote Jun 2, 2014 at 2:27 PM

I think that's actually where the problem comes in. Here's an example:

A required field called "Deal" results in a dropdown with > 20 items.
In IE, this initially gets generated as a complex dropdown called "Deal Required Field". SPComplexToSimpleDropdown sees the complex dropdown and converts it to a simple dropdown, renaming the field to "Deal" (without Required Field appended to the end).

In Chrome, this same field initially gets generated as a simple dropdown called "Deal Required Field". SPComplexToSimpleDropdown is smart enough to see that it is already a simple dropdown and leaves it alone. Its name in this case remains "Deal Required Field".

The end result is that the field is a simple dropdown in both browsers, but the name does not match between the browsers.

Thanks - John

sympmarc wrote Jun 2, 2014 at 2:49 PM

Ok, I get it. Sounds like an unintended "feature". I had to roll the fix out for the " Required Field" nonsense pretty fast and clearly missed this case.

M.

sympmarc wrote Oct 23, 2014 at 10:30 PM

John:

I'm finally getting to look at this. As crazy as it sounds, I think I need to gave the simple dropdown the "Deal Required Field" name in order to be consistent. In other words, whatever the column's title is originally, I should just clone it. Make sense to you?

M.

sympmarc wrote Oct 24, 2014 at 2:50 AM

Fixed in 2014.02ALPHA6

jriganati wrote Dec 16, 2014 at 6:17 PM

Hi Marc,

My apologies for not responding to this in October. I didn't realize you had left an update.

This approach does make sense. I think that "Required Field" being appended to the end is silly in the first place. But keeping it consistent with default behavior definitely seems like the way to go.

Thanks - John Riganati

sympmarc wrote Dec 16, 2014 at 6:32 PM

Thanks for the update, John!

M.