+ Start a Discussion
SKT CloudComputingSKT CloudComputing 

Issue with wrapper class.

VF Page-

<!----------- Creating this page for dispaly Opportunity fields object in single table with check box ---------->

<apex:page controller="WrapperIntStringDisplayClass">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!lstwrapperIntString}" var="w">
                    <apex:column headervalue="click2Select">
                        <apex:inputcheckbox />
                    <apex:column headervalue="Opportunity fields">

Apex Class-

public with sharing class WrapperIntStringDisplayClass {
    public List<wrapper> lstwrapperIntString {get;set;}
    public WrapperIntStringDisplayClass(){
        lstwrapperIntString = new List<wrapper>();
        for(opportunity opp : [select Id, Name,Amount from opportunity]){
            lstwrapperIntString.add(new wrapper(opp.Id,opp.Name,opp.Amount));
    //Wrapper Class Construction

    public class wrapper{
         public String Id{get;set;}
         public String Name{get;set;}
          public Double Amount{get;set;}
    // Wrapper class constructor
    public wrapper(String Id,String Name,Double Amount ){

I am getting Below error-

[Error] Error: WrapperIntStringDisplayClass Compile Error: Constructor not defined: [WrapperIntStringDisplayClass.wrapper].<Constructor>(Id, String, Decimal) at line 7 column 37

Can anyone help in this.
Best Answer chosen by SKT CloudComputing
SKT CloudComputingSKT CloudComputing
Sorry folks. I found my mistake I corrected the datatype.

 public wrapper(String Id,String Name,Decimal Amount )

 public Decimal Amount{get;set;}

It works now.