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
Priya GuleriaPriya Guleria 

how to assign a varrible value in outputfield in vf

Preya VaishnaviPreya Vaishnavi
using apex:outputfield you cant assign a variable value directly as output field expects only field value to  be used in it.You can use ouputtext to display the same.by assigning ,do you mean displaying the value on vf?
Priya GuleriaPriya Guleria
okk.. so how we display the variable value on VF pages
sfdcMonkey.comsfdcMonkey.com
hi Priya
try this
<apex:page controller="test">
<apex:pageBlock>
    <apex:pageBlockSection>
    
    
    <apex:form >     
        <apex:outputText value="{!setValue}"/> 
    </apex:form>
        </apex:pageBlockSection>
</apex:pageBlock>
</apex:page>
public class test{
     // set value by constructor
    public String setValue {get;set;}  
    public test(){
        setValue = 'test Text';
        
       }   
    }
Thanks
i hop it helps you :)