Monday, July 15, 2013

Filtering XSLT List view web part with Text filter Web parts

Applies to SharePoint 2013
Out of the several different filter webparts let’s try using a Text filter webpart

On a new non-webpart page created form designer add a dataview webpart and select a list

image

Select a Text Filter webpart

image

Change the filter name and Title name to something simple

image

We are going to create a filter on Lastname, the dataview webpart will display all the contact that contain this last name. High level strategry to achive this is to create a lastname parameter in DataView webpart, apply filtering based on lastname in the XSLT listview webpart and finally pass the value of this parameter from the list filter webpart. Lets start with creating a parameter in the xsltlistview webpart ,

image

Applied filter using this parameter

image

This will add the following CAML query to the Query section, before applying the filter it was only <Query/>

image

Now lets connect xslt listview webpart with text filter. With cursor in Contact List XSLTListview webpart click on ‘Add Connection’ and in the wizard select “Get Parameters From”, this basically means we are going to get the value of a Contact List parameter, the name of the parameter will be specified later in the wizard.

image

Hit on Next

image

Hit Next, select the text filter and select the action as send value to ,

image

Hit on Next to map the parameter of ContactsList (specified in the rt side of below image) to the name of the filter which is “Last Name” also( specified in left side).

image

finally hit on next and Finish

image

This basically adds the below spwebpartconnection to the page specifying the connection between the two webparts

image

Preview the page, type in the last name filter and you will see the values refresh in the XSLTListView in the bottom.

image

 

 

Check out my below posts on DataView Webpart, leave me a comment if you find them useful  

Using Dataview Webpart with SharePoint 2013
Difference between XsltListview webpart VS DataFormwebpart
Filtering XSLT List view web part with Text filter Web parts

Filtering XSLT List view webpart with Multiple SharePoint List filter webparts

Using Apply Filter Button webpart with multiple Filter webparts
Clearing filter selection on a DataView created by Filter Webparts

6 comments:

  1. Nice post.
    For me it feels like SharePoint Designer 2013 has taken a step back compared to 2010.

    Toolbar buttons grayed out when they shouldn't be.
    Control breadcrumb not always working.
    Tool bar tabs disappear once used, never to return (eg congiguring XSLTListViewWebPart).

    You'd think the product would be mature by now, but it just gets worse!

    I'm having trouble using XSLTListViewWebPart filtering from a query parameter. It works when the BindingParamater has a default value, but not otherwise.
    Do you have any hints for me?

    Thanks
    Martin
    PS I have June CU of SP2013 Server and 15.0.4454.1000 SPD 2103 x64

    ReplyDelete
  2. I've just come across another post where the user points out it works with the team site template, but not the blank template.

    I'm using the blank template with these features enabled:
    Enable-SPFeature -identity "WebPartAdderGroups" -URL $url
    Enable-SPFeature -identity "DocumentSet" -URL $url
    Enable-SPFeature -identity "BizAppsSiteTemplates" -URL $url

    ReplyDelete
  3. performed as it is as mentioned above but getting no result, empty library without entering any text in it.

    ReplyDelete
  4. please tell me a way around to get rid of this problem..!

    ReplyDelete
  5. I attempted this but for some reason, the changes in SPD do not update the site, so whenever I save and refresh I lose the changes. Any suggestions?

    ReplyDelete
  6. Hi

    When I insert the textfilter webpart it removes the Dataview webpart, are these webparts on the same page?

    ReplyDelete