I have implemented a custom claims provider. When I enter a term into the people picker, it queries the provider and returns a list of matching PickerEntity objects.
Debugging shows that the correct number of PickerEntity objects are getting sent back to SharePoint but the people picker doesn't display them. It does however show a string stating 'Showing x results' where x matches the number of results it should display.
My FillSearch method is as follows:
protected override void FillSearch(Uri context, string[] entityTypes, string searchValue, string hierarchyNodeID, int maxCount, SPProviderHierarchyTree searchTree)
{
// Ensure that People Picker is asking for the type of entity that we
// return; site collection administrator will not return, for example.
if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) { return; }
List<PickerEntity> matches = new List<PickerEntity>();
/*
removed code that retrieves the matches
*/
searchTree.AddEntities(matches);
}
The code that populates the list of matches does so by calling the following method
private PickerEntity GetPickerEntity(string claimValue)
{
PickerEntity pickerEntity = CreatePickerEntity();
pickerEntity.Claim = CreateClaim(BaseClaimType, claimValue, StringClaimValueType);
pickerEntity.Description = ProviderDisplayName + ":" + claimValue;
pickerEntity.DisplayText = claimValue;
pickerEntity.EntityData[PeopleEditorEntityDataKeys.DisplayName] = claimValue;
pickerEntity.EntityType = SPClaimEntityTypes.FormsRole;
pickerEntity.IsResolved = true;
return pickerEntity;
}
How can I have it display the results?