cancel
Showing results for 
Search instead for 
Did you mean: 

To color a specific row in a Table UI element

Former Member
0 Kudos

Hello Experts,

We have a requirement to highlight (with distinguish color) a specific row of a table UI based on column data.

Suppose we have a table with 5 column and 10 row, now if the data on 5th column greater than some XYZ value then we need to highlight the specific row with a different color.

Can anyone please help me to achieve this requirement?

Thanks & Regards,

Sambaran Chakraborty

Accepted Solutions (0)

Answers (2)

Answers (2)

Qualiture
Active Contributor
0 Kudos

Hi,

Have a look at my reply in this topic

This is for one cell, but can easily be adapted for a row

Cheers,

Robin

Former Member
0 Kudos

Hi,

Thanks for your input.

I checked that link, but need to know one thing.. will that approach work for a table with editable cell (input field).??

I need to color rows which are in editable mode (input field).

Please advise how can i archive that.

Regards,

Sambaran

Qualiture
Active Contributor
0 Kudos

Hi,

It will work, with two restrictions:

1) If your table has selectable rows, the color of the selected row is leading over the color of the individual cells

2) When you click an editable table cell, it's background color will change to the default color of an active editable table cell

Former Member
0 Kudos

Hi,

Can you please provide some code snippet .

Thanks,

Sambaran

Qualiture
Active Contributor
0 Kudos

Hi,

See the code snippet in the link I posted earlier. But since it's for a single cell, you just need to replicate for each cell in your row

Former Member
0 Kudos

I tried that, but it is not working when applied to Input field Cell Editor.

Former Member
0 Kudos

Every thing is working fine when i am using a TEXTVIEW element for Table Cell Editor. But when i am using a Input field it is not working..

Qualiture
Active Contributor
0 Kudos

That is strange, I have it working here in front of me with a table cell of type InputField...

Which version of NetWeaver / Web Dynpro are you using?

Former Member
0 Kudos

Version: 7.0.10

Let me explain what i did.

RootNode (binded to model node) --> Create a Value node ---> Add a attribute with type Table Cell Design

Into the table for a column ->with input field set the Cell design property of the column as the Attribute defined above.

Now i need to write some code to set the specific color as and when required.

Here can you provide your code.. and correct me if my previous steps are wrong..

Thanks

Sambaran

Qualiture
Active Contributor
0 Kudos

Hi,

In your outline, I am missing quite a few prerequisites which I mentioned (not sure if you have implemented them already)

  • your sub node, does it have singleton=false, cardinality 1..1 and selection cardinality 1..1?

  • The attribute of type TableCellDesign in that sub node, does it have the calculated property to true?

If you've bound each table column's cellDesign property to this calculated attribute, you just put some code in the generated generated get<SubNode><CalcAttribute> method to set the color

For instance by just entering the line

return WDTableCellDesign.CRITICALVALUE_LIGHT

;

in that method will render each linked cell to that color

Not sure what else I can say to explain this, there's not much to code...

Former Member
0 Kudos

Sorry to bug you again..

I did the same thing that you explained , but still no result..

Not sure what else i am missing...

Anyway thanks a lot for you help.

Regards,

Sambaran

Qualiture
Active Contributor
0 Kudos

Hi,

I'm sorry I can't help you further... not sure what else goes wrong. The one thing that bugs me is you have it working with a textview element, but for some reason it doesn't wrk with an inputfield

What do you see when using an inputfield? Just the basic white background color?

Former Member
0 Kudos

Yes just a basic while background color.

Qualiture
Active Contributor
0 Kudos

Strange.. As I don't have a 7.0 version available I can't check for myself, but there should be no difference in rendering between textview and inputfield table cells...

vishal_gupta15
Contributor
0 Kudos

hi,

try to manipulate the property "semanticColor", of table cell editor.(This property has a predefined set of values)

hope this will help

_vishal