Monday
Apr052010
Monday, April 5, 2010 at 23:08 | Post a Comment
Populating text box filters with URL query string parameter values
in Cascading, Multiple-Value List Filters, FilterZen, MOSS 2007, SharePoint 2010, SharePoint 2013, WSS 3.0, Web Part Connections, Web Parts
One easy way to pre-populate a single SharePoint FilterZen filter of yours via the page URL query string is using the parameter name filter_DefaultValue after having ticked the Override Web Part settings from URL parameters check-box option in the Filter Web Part's settings tool pane.
But what should you do if you need multiple parameters for multiple filters, or simply other, custom parameter names? This is actually fairly easy:
- For each Text Filter to pre-populate, add one corresponding URL Query String Filter.
- Give it any name you wish but this should be different from the corresponding Text Filter — for example, assuming your Text Filter is named City, then name your URL Page Request Filter CityParam or simply C or any other name.
- Important: disable your helper URL / Page Request Filters so that their values do not get sent to connected Web Parts directly, but are only used to pre-populate your Text Filters! Simply un-tick the This filter is enabled check-box option for each URL filter.
- For the default filter value option of the Text Filter, specify {$CityParam$} or {$C$} or whatever URL / Page Request Filter name you picked in the previous step.
- Now you can use the respective URL query string parameters, for example: page.aspx?CityParam=Hanoi or page.aspx?C=Zurich.
- If you want the URL parameter name to be different from your URL filter name, then simply set that filter up accordingly by following the GUI instructions.
Reader Comments