Developing Apama Applications > Building Dashboards > Attaching Dashboards to Correlator Data > Using table objects > Colorizing table rows and cells
Colorizing table rows and cells
The table object allows the color attributes of rows and cells to be set based on the value of a scenario variable or DataView field. Double-click Colored Table on the tutorial main page to see the following table, which shows a typical use for setting color attributes.
Here the Position cell is shown with green text if the position is positive and red text if it is negative. Colorizing a table can make it much easier to identify values of interest. Colorizing attributes are specified by setting the filterProperties property.:
1. Double click on the filterProperties property.
The Filter Properties dialog displays.
2. Double click on a filter to edit it or click on the Add button to add a new filter.
Here the filter specifies that the font color of the Position cell should be red if the value of Position is less than 0. The Condition fields allow you to specify the condition which must be matched for the action to take affect. The Action field allows you to set the font or background color or hide a row. Hiding a row is useful if you do not want the row to appear based on some attribute of the scenario instance. The Target field allows you to apply the action to single cell, row, or column.
A common use of table colorization is to provide a visual indication of the scenario instances which have ended or failed. For example you may want to set the font color to gray for those which have ended and red for those which have failed.
To do this you must include apama.instanceStatus as a display variable in the table’s data attachment and, typically, in the list of columnsToHide. The filter properties for the table can then be used to set the font color based on the value of apama.instanceStatus with the following two filters. The following illustrations show how the Edit Filter dialog can be used for this purpose.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.