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

please write the custem controller for this visualforce page

<apex:page Controller="con2" >
<apex:form >
<apex:pageMessages />
<apex:pageBlock title="Book data to Store" mode="edit">

<!--This is the first section-->
<apex:pageBlockSection Title="Book Information" columns="1">

<apex:pageBlockSectionItem >
<apex:outputText value="BookName"/>
<apex:inputtext value="{!bk.Name}"/>
<apex:pageBlockSectionItem >
<apex:outputText value="Authorname"/>
<apex:inputText value="{!bk.Authorname__c}"/>
<apex:pageBlockSectionItem >
<apex:outputText value="price"/>
<apex:inputText value="{!bk.price__c}"/>
<apex:pageBlockSectionItem >
<apex:outputText value="EmailId"/>
<apex:inputText value="{!bk.Emailid__c}"/>

<apex:pageBlockButtons location="top">

<apex:commandButton value="save" action="{!save}" />
<apex:commandButton value="Reset" action="{!Reset}" />

<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Delete" action="{!delete_selected}" />
<apex:commandButton value="Edit" action="{!Edit}" />
<apex:commandButton value="sendmail" action="{!sendMail}" />

<apex:pageBlockTable value="{!bks}" var="b" >
<apex:column headerValue="Action">
<apex:inputCheckbox value="{!b.action__c}" />
<apex:column value="{!b.Authorname__c}"/>
<apex:column value="{!b.Name}"/>
<apex:column value="{!b.price__c}"/>
<apex:column value="{!b.Emailid__c}"/>




Custom controller Purpose is, if you want to override the existing functionality, any custom navigations, to implement own custom logic, any callouts..... like this

By Def:
A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. Use custom controllers when you want your Visualforce page to run entirely in system mode, which does not enforce the permissions and field-level security of the current user.

so write custom controller if you want to implement your own logic.
hope you understand

Follow below links: