This, that and the other (may contain nuts)

XPages: Hide Detail Rows

Steve Castledine  16 February 2010 14:41:42
Very quiet around here as very busy (some very cool stuff) and still catching up on "I will document that for you" from Lotusphere. So here's one off that list "Hide Detail Rows".

So in Notes development we have the ability to add numeric values to columns and add totals. Often we are not interested in the number per row but just the totals, maybe by category:

Image:XPages: Hide Detail Rows
So we set the view column property "Hide Detail Rows" to achieve this:

Image:XPages: Hide Detail Rows
When we want to do the same for XPages, this particular property is not carried forward and so when creating a default view we get:

Image:XPages: Hide Detail Rows
So the first thing we need to do for this example is to make it a whole number. To do this we navigate to the column properties and section "data" and set display type to Number, and format as Decimal, Integer only.

Image:XPages: Hide Detail Rows
We then need to hide the detail rows, but before that we need to assign a "name" to our row data so we can reference it. We do this in the view panel properties under data and "var" (set to "rowData" below).

Image:XPages: Hide Detail Rows
We then change our totals column to display a computed value. Our computed value would then detect whether we are a category or document row (using isCategory()) and display a value accordingly:

Image:XPages: Hide Detail Rows
Image:XPages: Hide Detail Rows

if(rowData.isCategory()){return rowData.getColumnValue("$2")}


Image:XPages: Hide Detail Rows