cancel
Showing results for 
Search instead for 
Did you mean: 

How to Change the color of rows in a table

Former Member
0 Kudos

Hi all,

I'm running WebDynpro on a NW04 J2EE (no Portal or NW04s).

I have created a table with a binding to a model node. This model node gets its data from an RFC call (R/3 data) so I cannot add an own value attribute to that node. (So all threads in this forum telling me that I have to use the "SemanticColor" attribute does not work)

But depending on a special entry the whole row should be displayed in another color than the other rows.

How can I develop this?

regards

René

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Add a helper (value) node "Decoration" with cardinality=1:1, selection=1:1, singleton=false, and add all additional attributes inside that.

Armin

Former Member
0 Kudos

Hi Armin,

that would mean that I have to create a value node and add attributes to that value node as I have attributes in my model node plus an additional attribute for the "decoration".

Then it would be necessary to read out all entries in the model node and create entries in the value node accordingly.

Isn't there an easier way? This method also does not seem to be very high-performance as the model node can have hundreds or thousands of entries.

regards

René

Former Member
0 Kudos

No, add the helper value node under the model node (in the view controller context).

Armin

Former Member
0 Kudos

Hi Armin,

thanks, works great

regards

René

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

This option takes effect only for read-only tables. So set readOnly property of table to true.

U can check condition for a particular row and assign the color. For that u can do this,

Create a attribute of type property com.sap.ide.webdynpro.uielementdefinitions.TextViewSemanticColor in the table node itself,

based on a condition, u can set this attribute during you add a row.

Example code:

IPrivate<View>.I<Nodename>node node=wdContext.node<Nodename>

node.invalidate();

for(int j=0;j:size;j++)

{

IPrivate<View>.I<Nodename>Element ele=wdContext.Create<Nodename>Element();

hear made your check

ele.set<Attribute>(set the color);

node.addElement(ele);

}

also See this thread:

/people/sap.user72/blog/2006/04/25/colourful-table-in-web-dynpro

I hope this will be helpfull to you.

All The Best

Priyanka

Do Reward Points

Former Member
0 Kudos

Hi Rene,

Check out this blog

/people/sap.user72/blog/2006/04/25/colourful-table-in-web-dynpro

Regards,

Shubham