function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bhupendra yadavBhupendra yadav 

outputfield pass through attribute not working

SFDC documentatoin says that html pass through worksfork with outputfield, however whenever we bind the outputfield with any currency type field and try to pass through attribute it doen'st work. it behave in following way. Am I missing something here ?

Controller

public CObj__c CObj {get;set;}

VF page

<apex:outputField value = '{!CObj.Amount__c}' html-passedValue='XYZ'></apex:outputField>

Generated html
<span id="j_id0:j_id1:j_id14">$20</span>


Hence you can see that the pass through attribute is not generated. However if you change the binding variable to any type other then Currency, pass through will start working. as shown below.
Ashish_SFDCAshish_SFDC
Hi Bhupendra, 


This is the correct syntax, 

<apex:outputPanel layout="block" html-data-role="panel" html-data-id="main" <apex:insert name="main"/>


<apex:outputField value = "{!CObj.Amount__c}" html-passedValue="XYZ"></apex:outputField>

Try the text in double quotes and check if that works, 


Regards,
Ashish