Question
Pegasystems Inc.
JP
Last activity: 16 Sep 2021 7:05 EDT
how to conditionally change row background color for optimized cosmos table?
I am trying to change the row background color conditionally by embedding inline style as below.
<pega:when test="IsKeiyakuManryou">background-color: #a9a9a9;</pega:when>
However, it seems the same jsp code does not work if "allow optimize code" option is checked. (see screeshot below)
Is there a way to conditionally change row background color for optimized cosmos table?
I am trying to change the row background color conditionally by embedding inline style as below.
<pega:when test="IsKeiyakuManryou">background-color: #a9a9a9;</pega:when>
However, it seems the same jsp code does not work if "allow optimize code" option is checked. (see screeshot below)
Is there a way to conditionally change row background color for optimized cosmos table?
| Optimize code | settings | rendered screen |
|---|---|---|
| Not allow | ![]() |
![]() |
| allow | ![]() |
![]() |




@Chunzhi_Hong optimized table uses client side rendering and the old approach of using jsp tag inside a header cell is no longer supported.
To achieve a similar approach, include a section in the cell that should be styled conditionally
In the section property panel, use a property ref for the read and read-write class- this property could be a declared expression that will generate a class name depending on the case data.
In the section, add your property inside an inline-middle layout
For example, I am adding the pyID to the cell
The class will be added to the td - you can then add any custom styling but adding the some override CSS to your skin