Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

I while back I wrote about Multiple values in multiple rows in multiple columns about how to make the column values match up when you have multiple lists of values that you want to display on separate rows. These might either be from having multiple multi-valued fields, or one multivalued field with another list that you derive from it by substitution.

For instance, in the view above, the icon column converts the list of Attributes to a list of icons, as follows:

_chart := "Pwecious 7":"Fuzzy 194":"Naughty 81":"Yappy 195":"Funny 85":"Bwave 159";
_from := @Left(_chart; " ");
_to := @Right(_chart; " ");
@ToNumber(@Replace(Attributes; _from; _to))

(NOTE: An icon column can display multiple icons if its formula returns a list, but the list must contain only numbers, or only strings (referencing image resources). Macro language doesn't let you mix different datatypes in the same list)

So the values in the Attributes column, and the values in the icon column, match up by position. Now suppose you wanted a view sorted by Attributes, where if multiple attributes are selected, the goggie is listed multiple times, sorted by the attribute values. So we set the column of Attributes to "Show multiple values as separate entries" (VASE for short).

It's not hard to spot the problem; in the first row, the attribute "Bwave" should be represented by the star symbol in the icon column, but instead all of the icons for that goggie are displayed. It might be that's what you wanted; but let's suppose you would prefer to see only the icon for the attribute represented on that row.

The obvious solution is to set the icon column, also, to display multiple values on multiple rows. Here's the result:

It didn't work the way you might have hoped. Though column 2 is set to sort, it's only sorted by the groups established by column 1. But column 1 doesn't display all the different icon values; it only repeats the first one. This configuration, where there's an unsorted VASE column followed by a sorted VASE column, doesn't do anything useful. As the linked blog entry above shows, it's not a good idea to sort both VASE columns, and sorting only the first one results in a sort by icon number rather than attribute name.

Assuming you require the icon column to come first, the solution is to use a hidden VASE sorting column that duplicates the Attributes column, then do not sort the two other VASE columns:

Now the rows are sorted by Attribute, but the icon displayed near the attribute is the right one for that attribute.

Andre Guirard | 17 February 2010 10:00:00 AM ET | Home, Plymouth, MN, USA | Comments (0)

Search this blog 


    About IBM Privacy Contact