|XPages Tip: Filtering a View Data Source with URL Parameters
If you’re looking for a quick way to manipulate the data returned by a view data source, you can use URL parameters that match the property names. This allows you to effectively compute them without having to write code to compute the parameters. In this post, I’ll show several examples.
In my sample database, I have a categorized view in the Notes client.
I added a data source for this view to an XPages and dragged all of the columns on to the page to have it automatically create a view
Here’s the data source tag on the page — there are no computed properties.
<xp:dominoView var="view1" viewName="People"></xp:dominoView>
Using URL Parameters to Filter the View
To filter the view, all you have to do is append URL parameters with the same name as a filtering property of the view data source.
To limit the data to a single category, add a
To execute a full-text search, add a
search parameter. (The database must be full-text indexed or it will throw an error.) You can also include wildcards in the search parameter.
To filter the results based on the first sorted column in the view, use the
To set the view’s starting point, you can use the
startKeys parameter. (Note: The view will continue on to the end after the starting point.)
To expand or collapse categories in the view, use the
These attributes work on the view data source and not specifically on the view panel, so it is useful on a repeat control or any other control that uses a view data source.
If your data source has
ignoreRequestParameters set to true, then this will not work because it will – um – ignore the request parameters.
If you enter a parameter that doesn’t correspond exactly to a property name, then it will be ignored by the view data source.
Jul 07, 2014
| Recent Blog Posts
XPages Tip: Adding a Bootstrap Class to All Labels via the Theme (Redux)|
Wed, Jul 20th 2016 7:08a Brad Balassaitis
XPages Tip: Overriding, Concatenating, and Conditionally Adding Control Properties via a Theme|
Wed, Jul 20th 2016 7:07a Brad Balassaitis
XPages Tip: Displaying Bootstrap Applications Properly on Mobile Devices|
Tue, May 31st 2016 7:07a Brad Balassaitis
Efficiently Keeping an XPages Session Alive with JSON RPC|
Wed, May 25th 2016 7:07a Brad Balassaitis
Browser Session Lifespan – Idle Session Timeout vs LTPA Token Expiration|
Tue, May 24th 2016 10:15a Brad Balassaitis
I recently spent some time investigating a client’s reports of unexpected behavior with the duration of browser sessions while testing an application on a test server. From time to time, they were required to login even while actively using an application. In this post, I’ll highlight the difference between an idle session timeout and an […]
XPages Tip: Passing an Array to a Custom Control Property|
Tue, Apr 12th 2016 6:06a Brad Balassaitis
XPages Tip: Beware Server-Side code in Multiple onClientLoad Events|
Thu, Apr 7th 2016 6:06a Brad Balassaitis
Thu, Mar 24th 2016 7:07a Brad Balassaitis
Transferring a Bitbucket Repository|
Tue, Mar 22nd 2016 7:07a Brad Balassaitis
Handling Errors in an XPages RPC Method|
Wed, Feb 17th 2016 7:07a Brad Balassaitis