• JamalB
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I am trying to change the text color on a visualforce page to one of four colors based on data contained in a field.  The code is below.  I have looked at similar posts but have not been successful. I would appreciate any help you could provide.

<apex:repeat value="{!wrappedSystems}" var="s">
                                <tr class="linkable">
                                    <input type="hidden" class="id" data-type="system" data-id="{!s.sys.Id}" />
                                    <td><c:RC_Donut theName="{!s.sys.Id}" percent="{!s.batRemaining}" /></td>
                                    <td>{!s.sys.System_Name__c}</td>
                                    <td><center><font color = "{if({!s.sys.Operational_Status_Color__c}='Red',#FF0000, if({!s.sys.Operational_Status_Color__c}='Yellow',#FFF000, if({!s.sys.Operational_Status_Color__c}='Green',#01DF01,#808080)))}">{!s.sys.Operational_Status__c}</font></center></td>
                                    <td>{!s.sys.Status__c}</td>
                                    <td>{!s.sys.System_City__c}, {!s.sys.System_State__c}</td>
                                </tr>
                            </apex:repeat>


  • December 27, 2017
  • Like
  • 1
I am trying to change the text color on a visualforce page to one of four colors based on data contained in a field.  The code is below.  I have looked at similar posts but have not been successful. I would appreciate any help you could provide.

<apex:repeat value="{!wrappedSystems}" var="s">
                                <tr class="linkable">
                                    <input type="hidden" class="id" data-type="system" data-id="{!s.sys.Id}" />
                                    <td><c:RC_Donut theName="{!s.sys.Id}" percent="{!s.batRemaining}" /></td>
                                    <td>{!s.sys.System_Name__c}</td>
                                    <td><center><font color = "{if({!s.sys.Operational_Status_Color__c}='Red',#FF0000, if({!s.sys.Operational_Status_Color__c}='Yellow',#FFF000, if({!s.sys.Operational_Status_Color__c}='Green',#01DF01,#808080)))}">{!s.sys.Operational_Status__c}</font></center></td>
                                    <td>{!s.sys.Status__c}</td>
                                    <td>{!s.sys.System_City__c}, {!s.sys.System_State__c}</td>
                                </tr>
                            </apex:repeat>


  • December 27, 2017
  • Like
  • 1