Hello again,
I have built an extended lookup field to provide picker support. For this I have custom field type and custom field control. Field type looks like this:
<FieldType><Field Name="TypeName">LookupWithPicker</Field><Field Name="ParentType">Lookup</Field><Field Name="TypeDisplayName">$Resources:FieldDescriptions, LookupWithPickerDisplayName</Field><Field Name="TypeShortDescription">$Resources:FieldDescriptions, LookupWithPickerTypeShortDescription</Field><Field Name="UserCreatable">TRUE</Field><Field Name="FieldTypeClass">Sharepoint.Fields.Types.LookupWithPicker, $SharePoint.Project.AssemblyFullName$</Field><PropertySchema><Fields><Field Name="LookupList" Type="Text" DisplayName="Lookup List Id" MaxLength="36" DisplaySize="36" Hidden="TRUE" /><Field Name="LookupField" Type="Text" DisplayName="Lookup Field Name" MaxLength="36" DisplaySize="36" Hidden="TRUE" /><Field Name="LookupContentType" Type="Text" DisplayName="Lookup Content Type Id" MaxLength="255" DisplaySize="255" Hidden="TRUE" /></Fields></PropertySchema></FieldType>
public class LookupWithPicker : SPFieldLookup { #region Constructors public LookupWithPicker(SPFieldCollection fields, string fieldName) : base(fields, fieldName) { } public LookupWithPicker(SPFieldCollection fields, string typeName, string displayName) : base(fields, typeName, displayName) { } #endregion #region Public properties public override BaseFieldControl FieldRenderingControl { get { LookupWithPickerFieldControl ctrl = new LookupWithPickerFieldControl(this); ctrl.FieldName = InternalName; return ctrl; } } #endregion }
At this point everything works as expected except for the list view part:
I wonder why it's HTML encoded? Do I need to provide custom XSL too? I find it a bit confusing when display form renders this field properly without any customization required.