1

I am trying to implement People Picker in SharePoint 2013 application (Provider-Hosted App Model).

I had referred mainly the following articles for implementing the same: http://msdn.microsoft.com/en-us/library/office/jj713593(v=office.15).aspx

But it's giving me JavaScript error:

Object doesn't support property or method 'SPClientPeoplePicker_InitStandaloneControlWrapper'

Also tried including SharePoint Server side people picker instead of this one. Referred following links for the same: http://blog.qumsieh.ca/2008/07/21/how-to-use-the-people-editor-control-inside-sharepoint/

But when I deploy this page I get following error:

Object reference not set to an instance of an object.

Is there any alternative control for People Picker in 2013?

Or

Is there any other method to implement the same?

3

The link you provided for client side people picker, it only works for sharepoint hosted apps. That's why you are getting the JavaScript error.

You cannot use server side people picker in your provider hosted app as this is not supported at all.

I don't think there is a any direct way to use SharePoint's people picker for provider hosted apps.

A provider hosted app has 2 parts, an external web application and a SharePoint hosted component. You can use the client side people picker seamlessly within the SharePoint hosted component (any page or webpart encapsulated within SharePoint). If you try and use it on a page within an external web application, its not going to work.

You can try following link to achieve this: https://www.nuget.org/packages/Microsoft.Office.WebWidgets.Experimental/

https://officeams.codeplex.com/

0

I found another probably interesting solution to the poeople-picker in provider hosted app challenge: Instead of using the default people picker, I just built my own based on jQuery autocompleter and people search via CSOM.

The scenario:

  1. Provider hosted app for SharePoint / O365
  2. using jQuery autocompleter to setup a text box making queries to a specific source-url
  3. That source-url triggers a controller in the hosted app which posts a people-search query to SharePoint
  4. Search results are relieved from unneccecssary information and returned as json encoded array.

I implemented that with very few lines of code in a MVC5 provider hosted app for O365.

Advantages: Very easy to implement, highly flexible.

Disadvantage: Each autocompletion request triggers actually two http requests (one from jQuery, one from CSOM to the SharePoint-Search). Also, the people search does not deliver results exactly like the people-picker: searching for partial names does not work in most cases.

0

Take a look at PeoplePicker for provider hosted apps
from Office365 Developer Patterns and Practices.

This sample shows an implementation of a SharePoint People Picker control that can be used on provider hosted SharePoint apps.

Applies to
• Office 365 Multi Tenant (MT)
• Office 365 Dedicated (D)
• SharePoint 2013 on-premises

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.