cancel
Showing results for 
Search instead for 
Did you mean: 

Change the colour for the input field based on condition

Former Member
0 Kudos

Hi Experts,

I have a requirement to colour the input field based on the flag from the function module.It will be nice if atleast I could colour the border of the input field based on the condition from the function module.How do we achieve this in webdynpro? I want the colours yellow,red and green.

Please suggest.

Thanks,

Rajani

Accepted Solutions (0)

Answers (3)

Answers (3)

piyush_kumar6
Active Contributor
0 Kudos

Hi Rajani.

You can Change the color to table cell which is a textview using

<textview name>.setSemanticcolor(WDTextviewSemanticColor.<semantic color type>);

Create a context attribute of type WDTextViewSemanticColor, bind the TextView.semanticColor property to this attribute and set the value in the context on your condition

Regards,

Piyush

Former Member
0 Kudos

Hi All,

Thanks for the reply.

Piyush : I am using a InputField child element.How is it possible for this.

I guess the solution you gave is for the TextView child element,right??

And I want the colours yellow,red and green.The WDTextViewSemanticColor does not give the green and red colour......

How do we solve this?

Please suggest.

Thanks,

Rajani

vmadhuvarshi_
Contributor
0 Kudos

Rajani,

Inputfield UI element does not have the option to change background color. ['TextView' UI element|http://help.sap.com/saphelp_nw04s/helpdata/en/d6/1615736dfceb418105d31f4b37f772/frameset.htm] has this possibility but the text won't be editable.

For TextView, WDTextViewSemanticColor property provides color values Red and Green but not with these names. Red color can be assigned with value 'negative' and Green with 'positive'.

Of course, you can achieve editability and desired background colour with [UI element TableStandardCell|http://help.sap.com/saphelp_nw04s/helpdata/en/bf/084142646ab46be10000000a155106/frameset.htm], if it works for you.

Hope it helps,

Vishwas.

Former Member
0 Kudos

Thank you all for the replies.

Former Member
0 Kudos

Hi,

Check these threads

Thanksl

Gopi

former_member211296
Participant
0 Kudos

Hi

There is no API to change the colour of the input field in the WebDynpro Java.

Regards,

Prasath.