1
Vote

MultiSelectDisplay on Custom Multi-Value Lookup

description

From http://spxslt.codeplex.com/discussions/361161
 
TranseoSP,
 
I solved this on a similar issue with multiple select people picker not displaying properly, but modifying the MultiSelectDisplay template as follows:
 
<!-- http://spxslt.codeplex.com --> <xsl:template name="MultiSelectDisplay"> <xsl:param name="MultiSelectValue"/> <xsl:param name="MultiSelectDelimiter"/> <xsl:param name="MultiSelectSeparator"/> <xsl:choose> <xsl:when test="contains($MultiSelectValue, $MultiSelectDelimiter)"> <xsl:variable name="before" select="substring-before($MultiSelectValue, $MultiSelectDelimiter)"/> <xsl:if test= "string(number($before))='NaN'"> <xsl:value-of select="concat($before, $MultiSelectSeparator)" disable-output-escaping="yes"/> </xsl:if> <xsl:call-template name="MultiSelectDisplay"> <xsl:with-param name="MultiSelectValue" select="substring-after($MultiSelectValue, $MultiSelectDelimiter)"/> <xsl:with-param name="MultiSelectDelimiter" select="$MultiSelectDelimiter"/> <xsl:with-param name="MultiSelectSeparator" select="$MultiSelectSeparator"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:if test= "string(number($MultiSelectValue))='NaN'"> <xsl:value-of select="$MultiSelectValue" disable-output-escaping="yes"/> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template>
 
and calling it as follows:
 
<xsl:call-template name="MultiSelectDisplay"> <xsl:with-param name="MultiSelectValue" select="@AssignedTo"/> <xsl:with-param name="MultiSelectDelimiter" select="';#'"/> <xsl:with-param name="MultiSelectSeparator" select="' | '"/> </xsl:call-template>
 
This workaround will fail if a value in the multi select is actually a number.
 
Originally I tried to just display every second value, but on occasion, I found that one of the values did not start with a numberic value first. ( Name1;#242;#Name2;#342),
 
HTH
 
Tom

comments

tchmiel wrote Sep 11, 2012 at 2:22 PM

My scenario was on a Person or Group column, where allow multipe selections = "Yes", and only allow selection of: "People Only".

I have not tested other scenarios.

Tom

wrote Feb 21, 2013 at 11:47 PM