Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Notes and Domino Application Development wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category Redbooks Wiki: Best Practices for Domino 8.0 Web Application Development Redbooks Wiki: Building Domino Web Applications using Domino 8.5.1 Redbooks Wiki: Creating Plugins for Lotus Notes, Sametime, and Symphony Redbooks Wiki: Lotus Domino Development Best Practices Custom Search Scope...
Search
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Melissa L Snell
Contribution Summary:
  • Articles authored: 1
  • Articles edited: 1
  • Comments Posted: 0

Recent articles by this author

Xpages - changing the color of a single cell in a view Panel based on a field value

In Lotus Notes, it is possible to add view columns that "Use value as color". This can be used to change the background color andor text color of the entire row or just a specific cell. There are already articles on the Wiki that cover setting alternating row colors or changing the color of the ...

Community articleXpages - changing the color of a single cell in a view Panel based on a field value

Added by Melissa L Snell | Edited by Melissa L Snell on July 18, 2010 | Version 2
expanded Abstract
collapsed Abstract
In Lotus Notes, it is possible to add view columns that "Use value as color". This can be used to change the background color and/or text color of the entire row or just a specific cell. There are already articles on the Wiki that cover setting alternating row colors or changing the color of the entire row. This article focuses on how to change the color of just one cell depending on the value of a document.
Tags: View Column color, Xpages view column color, Xpages
The demonstration database contains products, which have "units in stock" and a "reorder level". When the standard Products view is displayed in Lotus Notes, a hidden column with "Use value as color" has been placed just before the "Units in Stock" column with the formula:
 
@If(UnitsInStock<=ReorderLevel;255:0:0:-1:-1:-1;-1:-1:-1:-1:-1:-1) 
 
This has the effect of changing the background color of the units in stock to red if the value is at or below the reorder level - time to buy some more!! 
 
The same effect is possible in Xpages. An attached PDF shows the screen shots accompanying the steps.
 
1) Add a hidden column to your view that contains the information that you will use to decide whether to apply the color or not. The column is required so that we can access the information in it once the view has been added to the Xpage. Hide it because we don't want to confuse anyone who will continue to access the native view in Lotus Notes. In this example, we already have the Units in Stock in the view, but we will also need to know the reorder level. A column was added to the view to hold the value of the reorder level.
 
2) Create a stylesheet (or modify an existing one already on the Xpage). Add in a classs with a background color: in this case 'redBackground'
 
3) Create a new XPage (or modify an existing one)
 
4) Add the stylesheet resource that contains your class to the Xpage from the Styles tab of the Properties panel for the XPage
 
5) From the Container Controls panel on the right-hand side of the Designer client, drag and drop a  "View" Control onto the XPage. In the dialog box that appears, select the view and click OK
 
6) Hide the Reorder level column and column header by unticking the "visible" property check box
 
 
 
 
 
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (5)
collapsed Versions (5)
Version Comparison     
VersionDateChanged by              Summary of changes
5Aug 9, 2010 8:56:39 AMMelissa L Snell  
4Jul 18, 2010 8:40:56 AMMelissa L Snell  
3Jul 18, 2010 8:33:30 AMMelissa L Snell  
This version (2)Jul 18, 2010 8:20:31 AMMelissa L Snell  
1Jul 18, 2010 7:54:01 AMMelissa L Snell  
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use