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
valipivalipi 

can u give any one example of extension to the customcontroller ?

Hi,

 

can u give me  any  one example of extension to the customcontroller  ?

 

vikas88vikas88

Hi,

 

<apex:page standardController="yourstandardcontroller" extensions="<yourcustomcontroller>">
/***********your page code ************/
</apex:page>


*************************controller***************************************************

public class cls_CarDetails
{
public cls_CarDetails(ApexPages.StandardController controller)
{
}

}

 

 

if this is your solution please marked it as solved

sfdc@isha.ax1814sfdc@isha.ax1814

thanku for your reply.

 

i want  an example on customcontroller extension..

 

 

 

 

souvik9086souvik9086

You can find here what you are looking for

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

vikas88vikas88

/****************************Page code*************************/

 

<apex:page standardController="Account" extensions="cls_cutomcontroller" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputPanel >Account Name:</apex:outputPanel>
<apex:inputField value="{!acc.name}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

/****************************controller code*************************/

 

public class cls_cutomcontroller {

public Account acc{get;set;}

public cls_cutomcontroller(ApexPages.StandardController controller)
{
acc=new Account();

}

public pagereference save()
{

insert acc;

return null;
}

}

 

if this is your solution please mark it as solved.