Jan 28 2019 07:24 AM
Hi,
I created a custom field in Sharepoint 2010 that inherits from SPUserField. (farm solution - wsp)
The only thing the custom field does is filling in the current logged in user as default value.
When I am deploying the custom field to Sharepoint 2016, the custom field is succesfully added as field type and I can create a column based on that type. No problems to create a list item, but when we have a look in the view of the list, the column is not rendered correctly (==> HTML is rendered as text).
Anybode any idea? :)
C# code: public override string DefaultValue {... }
XML file:
<FieldTypes>
<FieldType>
<Field Name="TypeName">CurrentUserField</Field>
<Field Name="ParentType">User</Field>
<Field Name="TypeDisplayName">My DisplayName</Field>
<Field Name="TypeShortDescription">My short description</Field>
<Field Name="UserCreatable">TRUE</Field>
<Field Name="Sortable">TRUE</Field>
<Field Name="AllowBaseTypeRendering">TRUE</Field>
<Field Name="Filterable">TRUE</Field>
<Field Name="ShowInListCreate">TRUE</Field>
<Field Name="ShowInViewForms">TRUE</Field>
<Field Name="ShowInSurveyCreate">TRUE</Field>
<Field Name="ShowInDocumentLibraryCreate">TRUE</Field>
<Field Name="ShowInColumnTemplateCreate">TRUE</Field>
<Field Name="FieldTypeClass">MyNamespace.FieldTypes.CurrentUserField, $SharePoint.Project.AssemblyFullName$</Field>
<Field Name="FieldEditorUserControl">/_controltemplates/UserFieldEditor.ascx</Field>
</FieldType>
</FieldTypes>
Result in the list view:
<span class="ms-noWrap"><span class='ms-spimn-presenceLink'><span class='ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10'><img class='ms-spimn-img ms-spimn-presence-disconnected-10x10x32' src='/_layouts/15/images/spimn.png?rev=40' alt='' /></span></span><span class="ms-noWrap ms-imnSpan"><span class='ms-spimn-presenceLink'><img class='ms-hide' src='/_layouts/15/images/blank.gif?rev=40' alt='' /></span><a class="ms-subtleLink" onclick="GoToLinkOrDialogNewWindow(this);return false;" href="/_layouts/15/userdisp.aspx?ID=1073741823">System Account</a></span></span>
Expected in list view:
System Account
Jan 29 2019 04:15 AM
SolutionI found the answer by myself, just to share that knowledge:
Now, by default: List views are using Client Side Rendering (CSR). You can change that behavior for that list view by editing the page -> editing list view web part and in the "Miscellaneous" section, you can check the "Server Render" option. (see printscreen)
Jan 29 2019 04:15 AM
SolutionI found the answer by myself, just to share that knowledge:
Now, by default: List views are using Client Side Rendering (CSR). You can change that behavior for that list view by editing the page -> editing list view web part and in the "Miscellaneous" section, you can check the "Server Render" option. (see printscreen)