You need to sign in to do that
Don't have an account?

styleClass doesn't work with outputField
The class attribute isn't being set when I use outputField. As you can see in my example the HTML output is missing the class attribute which was set to XXX
My Page:
<apex:page controller="TestPageCon">
<apex:outputField styleClass='XXX' value='{!field.amount}'/>
</apex:page>
My Controller:
public class TestPageCon {
public Opportunity getField() {
return [select id, amount from Opportunity limit 1];
}
}
Actual HTML output:
<span id="j_id0:j_id1">$60,000.00</span>
Where did my XXX go?
Wrapping the fields in an outputpanel works for me, styling and formatting:
<apex:outputpanel styleClass="OfferTextHeader"> <apex:outputtext value="{!$Label.RMOfferPrice} "/> <apex:outputfield value="{!Offer.Price__c}"/> </apex:outputpanel>
I noted in a related thread (https://developer.salesforce.com/forums/?id=906F000000094uuIAA) that no attributes of outputField work except "value".