Skip to Content

SharePoint 2010 SP1 peoplepicker and javascript

Seems that there has been a change to the the way the peoplepicker handles its genereated javascript. On a server pre-sp1, one could set the peoplepicker's ID through code and the generated script would be unique. Post sp1, there is a small portion that does not get refreshed: the var currentEntityEditorXml holds references to former data.
Perhaps there are other ways, but my solution was to make the ID of the peoplepicker somewhat dynamic, by adding the System.DateTime.Now.Millisecond.ToString().
This works (but you will need to figure out a way to find the control if you need to save. Control.FindControl does not work because you do not know the ID. You could create a simple recurrent FindControlBy StartsWith to find the right control...

Hope it helps