Domanda

Ho un piuttosto semplice modello di BCS:

public Guid Id { get; set; }
public SPFieldUrlValue Url { get; set; }
public string Description { get; set; }
public string Owner { get; set; }
public DateTime CreatedOn { get; set; }

La proprietà URL contiene sia il titolo e l'URL come qualsiasi proprietà di SharePoint collegamento ipertestuale. Il modello BCS ha il seguente tipo di descrittore per entrambi i metodi ReadList e ReadItem:

<TypeDescriptor Name="Url" TypeName="Microsoft.SharePoint.SPFieldUrlValue">
    <Properties>
        <Property Name="SPCustomFieldType" Type="System.String">`URL</Property>
    </Properties>
</TypeDescriptor>

Nel schema.xml della definizione di elenco Ho i seguenti valori per la raccolta campi:

<Field Name="BdcIdentity" DisplayName="BDC Identity" Hidden="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="BdcIdentity" Type="Text" />
<Field Name="Id" DisplayName="Id" Hidden="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Id" Type="Text" />
<Field Name="Url" DisplayName="Url" Format="Hyperlink" Hidden="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Url" Type="URL" />
<Field Name="Description" DisplayName="Description" Hidden="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Description" Type="Text" />
<Field Name="Owner" DisplayName="Owner" Hidden="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Owner" Type="Text" />
<Field Name="CreatedOn" DisplayName="Created On" Hidden="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="CreatedOn" Type="DateTime" />

Niente di stratosferico. Quando apro la visualizzazione predefinita, tuttavia, non visualizza l'URL corretto nella vista tabella - visualizza nulla. Nel singolo elemento visualizzare lo fa visualizzare correttamente. Ogni pensiero su come ottenere uno SPFielidUrlValue per rendere correttamente sulla UI?

È stato utile?

Soluzione

Dopo due mesi e mezzo (!!!!) PSS era in grado di trovare una soluzione utilizzando un foglio di stile XML personalizzato che viene memorizzato in Layouts / xsl:

<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[@Name='Url' and @Format='Hyperlink']" mode="URL_body" priority="1">
    <xsl:param name="thisNode" select="."/>
    <xsl:variable name="url" select="normalize-space(substring-before($thisNode/@*[name()=current()/@Name],','))" />
    <xsl:variable name="desc" select="normalize-space(substring-after($thisNode/@*[name()=current()/@Name],','))" />
    <xsl:variable name="descfld" select="$thisNode/@Description"/>
    <xsl:variable name="urlfld" select="$thisNode/@Url"/>
    <!--  URL: <xsl:value-of select="$urlfld" /><br/>
          Description: <xsl:value-of select="$descfld" /><br/>
      Link: -->
    <a href="{$url}" alt="{$desc}">
      <xsl:value-of select="$desc"/>
    </a>
  </xsl:template>
</xsl:stylesheet>

Altri suggerimenti

Secondo la pagina di MSDN BDC proprietà personalizzate :

Questa struttura non ha alcun effetto sui metodi diversi dal SpecificFinder.

Mi chiedo, come posso implementare questa xsl? Offcourse posso crearlo, e distribuirlo nei layout / xsl ... Ma non v'è alcuna connessione tra l'elenco esterno e il file XSL?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top