OfficeDev/PnP — pull request #232 by danbudimir (2014-11-05 02:06:13+00:00)
Title: Allow People Picker Control to properly deal standard windows claims

Standard windows claims only have one pipe character so this little bit "loginName.split('|')[2]" was returning blank and the display value in the drop down looked something like this "Johnny Foo (,)", the display is now more descriptive. Also, when repopulating the control using data retrieved from the FieldUserValue class the only properties you have are LookupValue and LookupId. LookupValue may be unique if the field is set in SharePoint to use the login as display name or (as in my case) it can be set to the users display name. When saving data back to SharePoint that had been retrieved from an existing user field I would run into "User not unique" errors because the display name was not... unique. I added the LookupId as a property of the PeoplePickerUser class then populate and use that value to properly add and remove the user from the control and SharePoint with no issues.