cancel
Showing results for 
Search instead for 
Did you mean: 

how to apply two css classses to FORMATEEDTEXTVIEW component ?

former_member195433
Participant
0 Kudos
932

Can i apply two CSS classes to one FORMTTEDTEXTVIEW component ?

I need to achieve two different colors for a single single sentence and show it on a FORMATTEDTEXTVIEW .

I have tried the following html text and i have defined two css classes in 'colorblue' and 'colorred' in css file

<p class="colorblue"> Some text <p>

<p class="colorred"> Another text :)</p>

var html =  '<p> Some text <p> <p> Another text :)</p>';
FORMATTEDTEXTVIEW_1.setHtmlText(html); 

I dont want to use two Components as text is dynamic and length isnt constant .

" This a string text which i need in two different colors and its dynamic "

Thanks,

Pramod

View Entire Topic
MustafaBensan
SAP Champion
SAP Champion

Hi Pramod,

Did you try executing the following script code to apply the CSS?:

FORMATTEDTEXTVIEW_1.setCSSClass("colorblue colorred")

Regards,

Mustafa.

former_member195433
Participant
0 Kudos

Mustafa,

I have tried that but it didnt work me. I was initially using color attribute in html tag which didn't yield any results and finally end up using Span and CSS attributes to get it work.

thanks

Pramod