What I am trying to do is make a page where if i click on button then all accounts with type "prospect" to be shown. below is all my code :
Controller Class
Public class q4{
List<account> acts;
public list<account> getacts(){
return null;
}
public pagereference type_prospect(){
acts = [Select name from account where type = 'Prospect'];
return null;
}
}
VF page code
<apex:page Controller="q4" >
<apex:form >
<apex:pageBlock title="Opportunity Record Display">
<apex:commandButton value="type_prospect" action="{ ! type_prospect }"/>
<apex:pageblockSection>
<apex:pageBlockTable value="{! acts }" var="acc" title="Account table">
<apex:column value="{! acc.type }"/>
<apex:column value="{! acc.Name }"/>
<apex:column value="{! acc.Industry }"/>
</apex:pageBlockTable>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
The page first get loaded up with "Opportunity Record Display" title and below the "type_prospect" button.
when i click on the button i expect it to acts to be filled with soql query and then table display the values of acts in each row.
but on clicking it shows
Visualforce Error:
Formula Expression is required on the action attributes.