0

Looks like a Salesforce defect where outputField style does not enable its font color. I am using it in a tag on an html table. Are other people seeing this and what work around have been used ? If a bug how does Salesforce become aware (hopefully not thru ideaXchange.)

<td><apex:outputField style="color: blue" value="{!s.Key_Broker_Contact_LU_PS__c}" /></td>

Using style within the shows the font color but in this case the value for Key_Broker_Contact_LU_PS__c is the 18 digit id for a contact record. Thus the need to use outputField as above.)

   <td style="color: blue"> {!s.Key_Broker_Contact_LU_PS__c} </td>
  • 1
    Salesforce does not care to know about bugs as they routinely close cases reporting them as out of scope. You learn to work around them or find other ways to do it. Best you can hope for is someone with paid premier support running into it and it being fixed. Or the devs run into it. – Eric Nov 15 '17 at 9:04
  • Try, outputText instead if it meets your needs – Eric Nov 15 '17 at 9:05
0

Here's a short example that illustrates that the styleand styleClassattributes are ignored and offers a work-around that makes use of a descendant CSS selector that does work:

<apex:page standardController="Contact">

    <style>
    .myClass1 {
        color: green;
    }
    .myClass2 > span {
        color: blue;
    }
    </style>

    <!-- Fails - nothing in the output -->
    <apex:outputField style="color: red" value="{! Contact.FirstName }"/>
    <br/>

    <!-- Fails - nothing in the output -->
    <apex:outputField styleClass="myClass1" value="{! Contact.LastName }"/>
    <br/>

    <!-- Works - explicit span outputs the class and the descendant CSS selector applies it to the field -->
    <span class="myClass2">
        <apex:outputField value="{! Contact.Birthdate }"/>
    </span>
    <br/>

</apex:page>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.