cancel
Showing results for 
Search instead for 
Did you mean: 

Changing colours of values in Table cell

Former Member
0 Kudos

Hello all,

I have a business requirement in which I have to display the data neatly on a table. The table is created dynamically as it is dependent on the R/3 output. The requirement is that if a value displayed in the table is negative, it has to be displayed in red. Is this possible using Web Dynpro?

Thanks in advance,

PKS.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It is possible in Webdynpro. For the table columns you will be having A textview as table cell editor attached. If you just want the font color to appear in red you can do so by changing the Semantic color property of the Text view dynamically at runtime.

For this you need to have an attribute of type com.sap.ide.webdynpro.uielementdefinitions.TextViewSemanticColor.

Regards,

Nagarajan

Answers (1)

Answers (1)

former_member197348
Active Contributor
0 Kudos

Hi Sachin,

After creating the table do like this.

IWDTable table =(IWDTable) view.getElement("table_ID");
IWDTableColumn column= (IWDTableColumn)table.getGroupedColumn(1);
// assuming your cell Editor is TextView
IWDTextView columnText =(IWDTextView) column.getTableCellEditor();
// you can directly  use this code just after creating 
if(value<0)
columnText.setSemanticColor(WDTextViewSemanticColor.NEGATIVE);

regards,

Siva