cancel
Showing results for 
Search instead for 
Did you mean: 

Could you people solve the problem in IWD Tables

Former Member
0 Kudos

Hi,

I am developing one application using IWdTables. I need to diplay one table cell data with color RED, if the data is negative.

I tried to solve the problem by getting TableCellEditor, but i was unable to change the color.

Could you people look in to the issue and send me the code to resolve my problem.

Thank you,

B.Sandeep Kumar

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Let "Rows" be the table data source node and "Value" be the attribute that stores the value.

Add a value node "Decoration" (cardinality=1:1,selection=1:1,singleton=false) under "Rows".

(If "Rows" is a value node, you can omit the helper node "Decoration" and add the attribute to "Rows")

Add a calculated attribute "Color" of type com.sap.ide.webdynpro.uielementdefinitions.TextViewSemanticColor under "Decoration".

Bind property "semanticColor" of the TextView (table cell editor) to attribute "Color".

In the getColor() method, you write something like

WDTextViewSemanticColor getColor(IDecorationElement element)
{
  IRowsElement row = (IRowsElement) element.node().getParentElement();
  return row.getValue() < 0
    ? WDTextViewSemanticColor.NEGATIVE
    : WDTextViewSemanticColor.STANDARD;
}

Armin