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
Pankaj Sharma 195Pankaj Sharma 195 

what is wrong in VF page or Apex Class ?

it is giveing error ->( Formula expression is required for attribute value in <apex:column> in message at line 4 column 43)

apex class->

public class class2
{
  
    List<Account> a= [select  Type from Account];
    
    public List<Account> getacc()
        {
            return a;
        }
}


Vf page->

<apex:page controller="class2">
   <apex:pageBlock title="List of Accounts">
       <apex:pageBlockTable value="{!acc}" var="a">
           <apex:column value="{a.Name}"/>
           <apex:column value="{a.Type}"/>
      
       </apex:pageBlockTable>
   </apex:pageBlock>
</apex:page>


 
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi, Pankaj Sharma,

May I suggest you need to add an " ! "mark in all values
<apex:column value="{!a.Name}"/>
           <apex:column value="{!a.Type}"/>

Hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar
 
RD@SFRD@SF
Hi Pankaj,

Rahul is right, but the exclaimation mark needs to be inside the curly bracket.
 
<apex:column value="{!a.Name}"/>
<apex:column value="{!a.Type}"/>

Regards
RD