Filter DVWP with xslt with parameter from connected LVWP in Sharepoint Designer

My setup is as follows: A user page on Sharepoint 2010 with a list view web part and a data view web part. When I select an item in LVWP, I want to filter out DVWP using the value of the multi-user search field. So I connected to the two web parts in such a way that DVWP gets the parameter from LVWP. I filter DVWP as follows:

<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[contains($pDataAftaleID,concat(@ID,';#',@ID))]"/> 

where pDataAftaleID is a parameter from LVWP.

My problem: everything works well if the selected item from LVWP has a value in the parameter field, but if it is not, Sharepoint does not seem to write null / empty or zero to the parameter and the filter parameter saves the value from the last selected element in LVWP with value, and therefore DVWP displays items from the previous item selected, rather than "no items to display."

Is there a way to force an empty field to be written, or can I set the parameter to zero each time DVWP boots up? Any suggestions?

+4
source share
1 answer
 <xsl:variable name="Rows"> <xsl:choose> <xsl:when test="/dsQueryResponse/Rows/Row[contains($pDataAftaleID,concat(@ID,';#',@ID))]"> <xsl:text>/dsQueryResponse/Rows/Row[contains($pDataAftaleID,concat(@ID,';#',@ID))]</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>0</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> 

Please check if this works or a variant of it.

0
source

Source: https://habr.com/ru/post/1441227/


All Articles