Is it possible to programmatically change background color in a view?

I’d like to format a view based on information contained in a document.

In a column where I’m displaying field B, if field A = 1 I want the background to be bright yellow, but if it isn’t I want the background to be the default color.

I doubt this is possible in the Notes client. I’ve done this for the web with the use of HTML views and CSS but I see no practical way of doing it in a Notes view.

Let me know your opinions,

Thanks,

Luc Millette

Subject: Is it possible to programmatically change background color in a view?

If this is on a per-document basis, then yes, it IS possible. Use a hidden column set to “Use value as color” before the column you want to colour. The value will be a number list in R:G:B:R:G:B format, with 0-255 as allowed values, the first triplet is the text colour, the second is the background colour. Don’t forget to put another “Use value as color” column after the coloured column to return the background to normal (the color columns act sort of like tags).

Subject: RE: Is it possible to programmatically change background color in a view?

Thanks it works like a charm. However, you inverted the sets.

the first one is for the background and the second is for the text color.

I don’t like the fact that there are twice as many columns because I want to apply that to each column, but it works perfectly and the columns are hidden anyway.

I find it wonderful that we have this control which I was skeptical at best was even possible.

Thanks for your knowledgeable and competent contribution (as usual) to this forum Stan.

Luc Millette

Subject: RE: Is it possible to programmatically change background color in a view?

I don’t like the fact that there are twice as many columns because I want to apply that to each column

A color column defines the colors for all columns to the right of it, until another color column comes along and redefines the colors, so if you want all columns to have the same colors, then you only need the one.

Subject: Is it possible to programmatically change background color in a view?

See Stan’s post if you want to change the colour of each row in a view, based on a value on the associated document.

I can’t think of a way (other than possibly using the API) to programatically change the view’s background colour before opening it based on a (for instance) profile document.

However, you could implement a combination of these two idea. For instance, simply insert the colour column as the very first (left-hand) column. Use the retrieved value (eg. Profile document - But there are other, better ways to store constant values) to ascertain exactly what colour should be displayed and set the column for that colour.

In this scenario, you just wouldn’t “terminate” the colour (revert to the default). That way, the entire line would be coloured. This would still leave the default view colour in between the rows and leave any category rows uncoloured, but could give you close to what you are looking for (I believe!).

Hope this helps!