cancel
Showing results for 
Search instead for 
Did you mean: 

How do you dynamically change the row color based on a value from back-end?

Former Member
0 Kudos

Gurus,

I am trying to dynamically change the row color based on a value from the back-end. I have read through some of the post here and tried the following:

I added a 'Value Attribute' to the node and set the type to com.sap.ide.webdynpro.uielementdefinitions.TextViewSemanticColor. On the getter method I added some logic. Then on the TextView - tableCellEditor, I changed the sementicColor to use this node. As a result, the text color of the row is dynamically changing, but I am unable to change the background color of the row.

I know this can be do on NW 2004s, but we are on NW 2004 SP18 and don't have one of the property type that is available on the 2004s version.

Does anyone know how to do it? Any help would be highly appreciated. Thanks.

Regards,

Abu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Abu,

Do like this.

1. Create a context variable(Say " color ") inside the node of ur table.

2. Assign the type "TableCellDesign" to the variable "color" from Local Dictionary -->com.sap.....uielementdefns.

3.For all the columns of ur table, bind the celldesign property to "color"

4.You can give the predefined colours from SAP to the rows(say for row 1) by assigning

wdContext.node<tableNode>().get<Table>ElementAt(0).setColor(WDTableCellDesign.CRITICALVALUE_MEDIUM);

Regards

Fahad Hamsa

Former Member
0 Kudos

Thank you for your quick responses.

Peter,

We cannot use cell variants with NW2004 its' only available in NW2004s.

Fahad,

The problem is the type com.sap.ide.webdynpro.uielementdefinitions.TableCellDesign is only available on 2004s not on 2004 SP 18, which is what we are on.

Regards,

Abu

Former Member
0 Kudos

Abu:

In this case I will try to map the design property of text editor to an attribute of the table node.

Regards

Former Member
0 Kudos

Peter,

I have already tried that and it does not change the row background color. Thx.

Former Member
0 Kudos

Abu,

Actually, there is no other way to alter background besides cell variants and cell design. So there is no way to implement your requirements in NW04

VS

Former Member
0 Kudos

Thank you everyone for taking the time to answer my question. I will close this thread.

Abu

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi:

did you try cell variant?