Forum Stats

  • 3,827,925 Users
  • 2,260,839 Discussions
  • 7,897,407 Comments

Discussions

Table row text color

kchemweno
kchemweno Member Posts: 92 Blue Ribbon
edited Oct 11, 2017 1:20AM in JDeveloper and ADF

Am using Jdeveloper 12c and I want to color the text in some rows with green color.

I am not interested in the background color but the color of the text.

How do I achieve that?

Tagged:
kchemweno

Best Answer

  • ManishPandey
    ManishPandey Member Posts: 1,722 Silver Trophy
    edited Oct 10, 2017 5:57AM Answer ✓

    If your column contain outputText then use inlineStyle and for inputText use contentStyle

       <af:column sortProperty="#{bindings.FaCtrlView1.hints.Lcdate.name}"

                           sortable="false" headerText="Lock Date" id="c13"

                           width="100"

                           visible="#{bindings.PackageCd.inputValue == 'GST' ? false : true}"

                           inlineStyle="#{row.bindings.LockDate=='Y' ? 'background-color:#ff4d4d;' : ''}"

                           >

                     

                  <af:inputText value="#{row.bindings.Lcdate.inputValue}"

                                label="#{bindings.FaCtrlView1.hints.Lcdate.label}"

                                required="true"

                                shortDesc="#{bindings.FaCtrlView1.hints.Lcdate.tooltip}"

                                id="id3" minValue="#{row.bindings.MinDt.inputValue}"

                                maxValue="#{row.bindings.MaxDate.inputValue}"

                                contentStyle="#{row.bindings.DtColor.inputValue=='G'? 'color:Green':'color:Red'}"

    if its not based on condition simply write

    contentStyle="color:Green"

    kchemweno

Answers

  • ManishPandey
    ManishPandey Member Posts: 1,722 Silver Trophy
    edited Oct 10, 2017 5:57AM Answer ✓

    If your column contain outputText then use inlineStyle and for inputText use contentStyle

       <af:column sortProperty="#{bindings.FaCtrlView1.hints.Lcdate.name}"

                           sortable="false" headerText="Lock Date" id="c13"

                           width="100"

                           visible="#{bindings.PackageCd.inputValue == 'GST' ? false : true}"

                           inlineStyle="#{row.bindings.LockDate=='Y' ? 'background-color:#ff4d4d;' : ''}"

                           >

                     

                  <af:inputText value="#{row.bindings.Lcdate.inputValue}"

                                label="#{bindings.FaCtrlView1.hints.Lcdate.label}"

                                required="true"

                                shortDesc="#{bindings.FaCtrlView1.hints.Lcdate.tooltip}"

                                id="id3" minValue="#{row.bindings.MinDt.inputValue}"

                                maxValue="#{row.bindings.MaxDate.inputValue}"

                                contentStyle="#{row.bindings.DtColor.inputValue=='G'? 'color:Green':'color:Red'}"

    if its not based on condition simply write

    contentStyle="color:Green"

    kchemweno
  • Sam11116
    Sam11116 Member Posts: 355 Blue Ribbon
    edited Oct 10, 2017 10:32AM

    you want to add colors to SOME rows.

    You have a pattern for that some rows or a condition?

    kchemweno
  • kchemweno
    kchemweno Member Posts: 92 Blue Ribbon
    edited Oct 11, 2017 1:17AM

    Thanks Manish and Sam11116.

    Manish, your solution worked like charm. Thanks

  • kchemweno
    kchemweno Member Posts: 92 Blue Ribbon
    edited Oct 11, 2017 1:19AM
  • kchemweno
    kchemweno Member Posts: 92 Blue Ribbon
    edited Oct 11, 2017 1:20AM

    Thanks Manish. It worked.

This discussion has been closed.