문제

두 개의 목록이 있습니다. "부모"와 "어린이"라고 해봅시다."자식"목록이 "부모"를 가리키는 목록이 있습니다.

자식 목록의 사용자 정의보기에서 URL에 상위 ID가있는 사용자 정의 페이지에 대한 링크가있는 "하위"디스플레이의 제목을 갖고 싶습니다.

자식보기의 사용자 정의 XSL에서는 다음과 같이 작성했습니다 :

<a href="{$ServerRelativeUrl}/Pages/myPage.aspx?MyID={substring-before(@Parent., string( ';'))}" title="Open parent">
    Open Parent
</a>
.

예상대로 작동하지 않습니다. myid 인수가 비어 있습니다.

쓸 경우 :

<a href="{$ServerRelativeUrl}/Pages/myPage.aspx?MyID={@Parent.}" title="Open parent">
    Open Parent
</a>
.

myid는 1;#1, spfieldlookupvalue 양식의 값입니다.

원격 ID를 올바르게 추출하여 링크를 작성할 수 있습니까?

추신 :이 목적을 위해 XSLT View WebPart를 사용하도록 선택합니다.더 나은 대체 솔루션이있는 경우 주저하지 않으려 고 주저하지 마십시오.

도움이 되었습니까?

해결책

I'd just break it down a bit and do the substring-before operation before using it to look at why your substring is going wrong.

<xsl:variable name="myId" select="substring-before(@Parent., ';')" />
Parent: <b><xsl:value-of select="@Parent."/></b><br />
myId: <b><xsl:value-of select="$myId"/></b><br />
<a href="{$ServerRelativeUrl}/Pages/myPage.aspx?MyID={$myId}" title="Open parent">
    Open Parent
</a>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top