Skip to main content link. Accesskey S
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • Lotus Notes and Domino Application Development wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.0
  • 6.5
  • 8.0
  • 8.5
  • 8.5.1
  • 8.5.2
  • 8.5.3
  • action bar
  • Agents
  • Ajax
  • app dev
  • Application
  • beginner
  • C&S
  • calendaring and scheduling
  • client
  • composite applications
  • Controls
  • converters
  • css
  • Custom controls
  • Data Binding
  • db2
  • design elements
  • dialog boxes
  • Documents
  • Dojo
  • Domino
  • Domino Designer
  • Domino Designer 8.5
  • DXL
  • Eclipse
  • error handling
  • errors
  • extensions
  • FAQ
  • Forms
  • formulas
  • getting started
  • globalization
  • Help
  • html
  • Installation
  • interface
  • internationalization
  • iPhone
  • Java
  • JavaScript
  • localization
  • Lotus Domino Designer
  • LotusScript
  • LotusSphere
  • LotusTechInfo
  • menu bar
  • Mobile
  • new user
  • Notes
  • Notes 8
  • notes.ini
  • NSD
  • OpenNTF
  • partial update
  • performance
  • Pickers
  • Portal
  • presentations
  • programming
  • Redbooks
  • Requested Articles
  • roadmap
  • rooms and resources
  • samples
  • Scripting
  • security
  • tabs
  • templates
  • themes
  • Tips
  • toolbar
  • troubleshooting
  • tutorials
  • validation
  • variables
  • video
  • VideoFest
  • View
  • view control
  • ViewPanel
  • Views
  • web
  • Web apps
  • Web services
  • webdev
  • XML
  • Xpage
  • XPages
  • XPages Extensibility API
  • xsp-config
  • データソース
  • 九州地区ノーツパートナー会
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > XPage Tutorials > Automatically changing colours in XPage view objects
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Automatically changing colours in XPage view objects 

expanded Abstract
collapsed Abstract
A step by step example of how to automatically colour a cell in a View based on data stored in the underlying document.

Foreign Language Help for all you Americanised Googlers: color … color … color

Download the attached PDF ...  it's got a bunch of screencaptures that make it all easier to understand.

 

Automatically changing colours in XPage view objects

Foreign Language Help for all you Americanised Googlers: color … color … color

 

The Objective here is to colour a cell in a View based on a picklist in a form.  I want each task to have a colour which can be individually assigned. Of course, I might also desire the colours to represent tasks assigned to particular individuals (eg all of Tom’s tasks are colourcoded ‘YellowOnBlack’) but I’ll leave that exercise as an Extra Credit option if you finish this exercise early.

 

 

STEP 1:  Create a CSS with a list of colours. I used W3C web standard colour names but in a production application I would be tempted to define the colours using #RRGGBB codes:

*

ProjectColours.CSS

.LightRedOnWhite{

      color: LightRed;

      background-color: White;

}

.DarkRedOnWhite{

      color: DarkRed;

      background-color:  White;

}

.LightBlueOnWhite{

      color: LightBlue;

      background-color: White;

}

 

.DarkBlueOnWhite{

      color: DarkBlue;

      background-color: White;

}

etc

etc

*

STEP 2: Put the CSS colour names into a multivalue keyword document

 

 

STEP 3:  Create a Custom Control with a combobox using Labels and Values populated via a  dblookup eg '@DbLookup(@DbName(),"Keyword",'"Colour",2)

 

STEP 4:. Name the project document and the colour combobox on the Custom Control for future reference. I set the document name = 'ProjectDoc' and the combobox field = 'ProjectColourText'.

 

STEP 5: Select the Style tab for the Custom Control and add the 'ProjectColours' style sheet. Set the Style Class of the combobox to the Expression Language value 'ProjectDoc.ProjectColourText'. This will make  the combobox display using the colour values defined in the CSS

 

STEP 6: You can now start creating Project documents and assigning them colours. When you assign a colour the display of the Project Colour field will change to match your selection:

 

STEP 7:  We now need to have the selected colours displayed on the top level view of the documents. Set the Data Var for the View object to 'SelectedProjDoc'. (Note that this is the 'Data Var' setting ... not the 'Data\Data Var' setting).

 

STEP 8:  The final step is to tell the selected columns within the View object that they should use the value retrieved from the ProjectColourText field within each document as the CSS colourvalues for that particular document.


expanded Article information
collapsed Article information
Category:
XPage Tutorials
Tags:
, tutorials

This Version: Version 2 September 17, 2010 1:21:01 AM by Graham Dodge  

expanded Attachments (1)
collapsed Attachments (1)

 


File TypeSizeFile NameCreated On
application/pdf 114 KB Creating colourful views based on a picklist in a form.pdf 9/17/10 12:56 AM
expanded Versions (2)
collapsed Versions (2)
Version Comparison     
Version Date Changed by               Summary of changes
This version (2) Sep 17, 2010 1:21:01 AM Graham Dodge  
1 Sep 17, 2010 12:56:16 AM Graham Dodge  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • IBM Social Business User Experience Blog
  • IBMSocialBizUX on Twitter
  • IBMSocialBizUX on Facebook
  • Lotus product forums
  • IBM Social Business UX blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use