Monday, February 18, 2013

People Picker Plus for SharePoint 2010

A no-touch replacement for the horrid built in people picker control

Finally finished it up! Get it on CodePlex: http://peoplepickerplus.codeplex.com/

The SharePoint 2010 People Picker has always caused problems for me. Either by not working in what it deems to be 'down level' browsers (Firefox and Chrome), showing red X's instead of user images, random script errors, or totally failing within an HTML5 doctype, the list of crap I have taken from it is extensive. So I finally had enough and developed a solution to bury it with a much more user-friendly and sensible component. Oh yeah, and it works the same under all BICA (Browsers I Care About), like IE 9+, Chrome, Firefox, and even poor little Safari. The major features of it include:
  • Activate 'n Go! Activate the site collection scoped feature and be done - all people pickers will be replaced within the site.
  • Cross-browser! Unlike the built in entity picker, which devolves into a textarea for non-IE browsers, the People Picker Plus works the same way no matter what browser is being used. Also, it is HTML5 friendly.
  • Autocomplete Searches!As the user types, search results are displayed, and even grouped by User, SharePoint group, and Security Group.
  • User Image ProxyUser images located on mysites usually cause an annoying extra authentication prompt within the default people picker dialog. Your users won't miss this!
  • Decent UI!The UI for the built in people picker is awful. Especially for 'down level' browsers like Chrome and Firefox. The UI for the People Picker Plus is better than awful! Plus it is touch-friendly, should your users be crazy enough to try to use SharePoint on a tablet.

Feedback is greatly appreciated, especially of the constructive kind. If you feel the need to hit me with anything negative, it better contain humor.

Friday, February 1, 2013

HTML5 + SharePoint People Picker: I give up!

The SharePoint 2010 people picker is a piece of crap. Plain and simple. I have not had a chance to check out what 2013 has to offer for a people picker control – honestly I am a little scared to. I just know that the people picker breaks all the time in IE under normal circumstances, and when you try to use an HTML5 master page on your SharePoint site, it gets even worse. There are some ways to try to fix it that people have put out there (see here: http://social.msdn.microsoft.com/Forums/da/sharepoint2010general/thread/8c83010e-d351-48ba-bd1e-1ffb0641ec03) but but I have not come across a 100% solution to fix IE yet that results in a working HTML5 page.

This is the funny part: When the browser is not IE – something superior like Chrome or Firefox – the people picker is functional. It is ugly – showing login names rather than display names – but that is a small price to pay for having it be functional. Plus it has always been ugly. So I thought – ‘Hey, what if I could make the code think it was using a different browser so the people picker can work…’ And here is how I did it:

Add this JavaScript to the bottom of your master page. (If you do not have a custom master page, you are out of luck – since most of the people pickers can be found on layouts pages.)

if (typeof (PreferContentEditableDiv) == "function") {
//force downlevel people picker because HTML5 + IE makes people picker more terrible than usual
PreferContentEditableDiv = _PreferContentEditableDiv;
$("div.ms-inputuserfield").css("display", "none");
$("textarea.ms-inputuserfield").css({"display": "inline", "position":"static"});
}

 
© I caught you a delicious bass.
Back to top