3 Replies Latest reply on Nov 28, 2016 4:35 AM by Asim Shaikh

    Change Text Color depending upon text

    Asim Shaikh Novice

      Hello Everyone.

      Could anyone told me how could I apply multiple conditions to h:outputText.


      example. if Text is AAA then Color="red" ,  if Text is BBB then Color="green" if Text is CCC then Color="blue"



      Below code runs perfect for single condition. I wanted to add more conditions to it.


      <rich:column style="width:8%;">

      <f:facet name="header">#{lbl['label.eventstatus']}</f:facet>

         <h:outputText value="#{event.eventStatusDesc}"  

         style="#{event.eventStatusDesc eq 'Completed' ? 'color: red;font-weight: bold;':'color: black;'}" />

      <h:outputText value="    "/>

        <h:outputText value="#{event.resheduleDateString}"/>