The ability to customize the summary section allows you take the interface of the Data View to another level. You’re not limited to just a link based on the summary column — you can take full control over the layout and add more information.
Data View Series
- Part 1 – Overview
- Part 2 – Creating a Data View
- Part 3 – Collapsible Details
- Part 4 – Icon Columns
- Part 5 – Pager Add Rows Control
- Part 6 – Pager Save State Control
Custom Summary Examples
For the sake of comparison, here’s a data view with just a summaryColumn defined:
Let’s take a look at a few examples of Data Views with customized summary sections.
Here’s an example from the second NotesIn9 video I did on the Data View control. It’s nothing fancy, but you can see the concept of adding more information to the summary. Additional information can still be included in the collapsible detail section.
Here’s an example from IBM Domino Developer wiki. This summary includes graphics and 3 lines’ worth of information.
Here’s an example from an application that I recently worked on with Kathy Brown, master of icons. The images are used to convey information without requiring labels that would repeat on every row.
The possibilities are endless.
Customizing the Summary
All you have to do to customize the summary section is to drag and drop a container control (panel or div) into the summary facet of the data view, then put whatever you want inside that container.
You’ll need to use the Data View variable (var property) to access information in the view entry.
Creating Your Own Link
One thing to keep in mind is that you will have to manually add the link to open the document if you create a custom summary.
In order to pick up the same styling as the default summary column data view link, use a Computed Field control, set it’s Content type to HTML and output the link as an <a> tag within an <h4> tag.
You’ll then need to build link to open the document.
Here’s an example, assuming the var property of the data view is set to rowHandle.
return "<h4><a href='PageName.xsp?openDocument&documentId=" + rowHandle.getUniversalID() + "'>" + rowHandle.getDocument().getItemValueString('FieldName') + "</a></h4>";
