Lookup Sharepoint 2013

Apr 9, 2013 at 5:10 PM
Hi,

I've managed to deploy the lookup with picker to sharepoint 2013 it works great, the only problem is in list view where the html doesn't render.

Is showing like this: <a onclick="OpenPopUpPage('http://ren-dev-44/sites/documentos/_layouts/15/listform.aspx?PageType=4&ListId=6cffa43a-6056-4167-9b41-dff9f901b0dd&ID=28&RootFolder=*', RefreshPage); return false;" href="http://ren-dev-44/sites/documentos/_layouts/15/listform.aspx?PageType=4&ListId=6cffa43a-6056-4167-9b41-dff9f901b0dd&ID=28&RootFolder=*">Vitor Manuel Fernandes</a>;

Any sugestions??
Apr 21, 2013 at 7:40 PM
Edited Apr 21, 2013 at 7:44 PM
The same happens to me using Filtered Lookup in Sharepoint 2013. If you give a look to the generated HTML, there is something wrong with te JSON serialization of lookup field data in the AllItems.aspx page. The JSON data is used from the page to build the list view with the client side rendering (CSR). I've resolved doing an override of the JSLink property of the field class, by pointing to a custom javascript that render the lookup only in the list view mode (because edit, display and new works normally).
May 4, 2013 at 9:50 AM
Hi vitan79,

Can you please explain how you solved the issue, or maybe you can provide an example?

Thank you.
Jul 3, 2013 at 6:43 PM
Has anyone received a clear resolution to this issue? I am experiencing the same behavior. Thanks!
Oct 11, 2013 at 1:05 PM
Edited Oct 14, 2013 at 3:42 PM
Same behavior here.
Oct 14, 2013 at 3:42 PM
You should edit List Viewer Web Part and add link to XSL-file (f.e. uploaded to SiteAssets) with following structure:
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
                xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
                version="1.0" exclude-result-prefixes="xsl msxsl ddwrt"
                xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
                xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
                xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:SharePoint="Microsoft.SharePoint.WebControls"
                xmlns:ddwrt2="urn:frontpage:internal">
  <xsl:template match="FieldRef[@FieldType='LookupFieldWithPicker']" mode="URL_body">
    <xsl:param name="thisNode" select="."/>
    <!-- Hyperlink for History List goes here --> 
  </xsl:template>
</xsl:stylesheet>
Dec 4, 2013 at 10:46 AM
I had the same issue with my codeplex project which is based on Lookup field. I added a link to dummy JS file and overrode the JSLink property of the field class. I have blogged about it http://sharepointnadeem.blogspot.in/2013/12/sharepoint-2013-upgrade-sharepoint-2010.html
Aug 11, 2014 at 8:56 AM
Edited Aug 11, 2014 at 9:37 AM
add this to LookupFieldWithPicker.cs
    //Point to a dummy js file.
    private const string JSLinkUrl = "/_layouts/15/NY.Autocomplete.LookupField/JS/dummy.js";
    public override string JSLink
    {
        get
        {
            if (SPContext.Current.FormContext.FormMode != SPControlMode.Invalid)
                return base.JSLink;
            else
                return JSLinkUrl;
        }
        set
        {
            base.JSLink = value;
        }
    }
Sep 4, 2014 at 3:44 PM
I'm using Autocomplete (autocompletelookupsp2013.codeplex.com), and had the same error.
I fixed it by adding the Web Part > Edit Web Part. Under "miscellaneous", Enable "Server Render".
Click "OK", save the page,

Voila! Worked for me anyway :)