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
Ranadheer chRanadheer ch 

i created a wraper to display opp when selected from list...so here the prob is am getting this error even if call the method

i created a wraper to display opp when selected from list...so here the prob is am getting this error even if call the method ....am getting this error.. Unknown property 'wraperforopp.prosses

Here is my vf page and class


VF page:

<apex:page controller="wraperforopp" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="{!prosses}" title="Click here"/>
</apex:pageBlockButtons>
<apex:pageblockSection title="All Accounts" collapsible="false" columns="2">
<apex:pageBlockTable value="{!oppertunitycrete}" var="o">
<apex:column >
<apex:inputCheckbox value="{!o.Selected}"/>
</apex:column>
<apex:column value="{!o.opp.name}" title="OPP Name"/>
<apex:column value="{!o.opp.Amount}"/>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!createinnew}" var="h">
<apex:column value="{!h.name}"/>
<apex:column value="{!h.Amount}"/>
</apex:pageBlockTable>
</apex:pageblockSection>
</apex:pageBlock>

</apex:form>

</apex:page>


My class:

public class wraperforopp {

    


 public List<wraperopp> oppertunitycrete{get;set;}
 public List<opportunity> createinnew{get;set;}
 
 
 Public wraperforopp(){
 if(oppertunitycrete==null){
 oppertunitycrete=New List<wraperopp>();
 for(opportunity o:[select id,name,Amount from opportunity limit 10]){
 oppertunitycrete.add(new wraperopp(o) );
 }
 }
 }
 

    public void prosses(){
    createinnew=New List<opportunity>();
    for(wraperopp wraperoppobj:oppertunitycrete){
    if(wraperoppobj.Selected==true){
    createinnew.add(wraperoppobj.opp);
      }
     }
  }
 
 
 public class wraperopp{
 public opportunity opp{get;set;}
 public Boolean Selected{get;set;}
 
 public wraperopp(opportunity op){
 opp=op;
 Selected=false;
 }
 }
}


this is my class and controller ...here even i called the prosses then also am getting this error :Unknown property 'wraperforopp.prosses

What to do...thanks in advance
Best Answer chosen by Ranadheer ch
Wizno @ ConfigeroWizno @ Configero
<apex:commandButton value="{!prosses}" title="Click here"/>

Should be

<apex:commandButton action="{!prosses}" value="Click here"/>

Value changed to Action, and Title changed to Value. 

That should make the button fire. 

All Answers

Wizno @ ConfigeroWizno @ Configero
<apex:commandButton value="{!prosses}" title="Click here"/>

Should be

<apex:commandButton action="{!prosses}" value="Click here"/>

Value changed to Action, and Title changed to Value. 

That should make the button fire. 
This was selected as the best answer
Amit Chaudhary 8Amit Chaudhary 8
Please try below code that will work

<apex:page controller="wraperforopp" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >

    <apex:commandButton action="{!prosses}" value="Click here"/>

</apex:pageBlockButtons>
<apex:pageblockSection title="All Accounts" collapsible="false" columns="2">
<apex:pageBlockTable value="{!oppertunitycrete}" var="o">
<apex:column >
<apex:inputCheckbox value="{!o.Selected}"/>
</apex:column>
<apex:column value="{!o.opp.name}" title="OPP Name"/>
<apex:column value="{!o.opp.Amount}"/>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!createinnew}" var="h">
<apex:column value="{!h.name}"/>
<apex:column value="{!h.Amount}"/>
</apex:pageBlockTable>
</apex:pageblockSection>
</apex:pageBlock>

</apex:form>

</apex:page>

******************************************************************

public class wraperforopp 
{
 public List<wraperopp> oppertunitycrete{get;set;}
 public List<opportunity> createinnew{get;set;}

public wraperforopp()
{
    if(oppertunitycrete==null)
    {
        oppertunitycrete=New List<wraperopp>();
        for(opportunity o:[select id,name,Amount from opportunity limit 10])
        {
            oppertunitycrete.add(new wraperopp(o) );
        }
    }
}
 
public void prosses()
{
    createinnew=New List<opportunity>();
    for(wraperopp wraperoppobj:oppertunitycrete)
    {
        if(wraperoppobj.Selected==true)
        {
            createinnew.add(wraperoppobj.opp);
        }
    }
}
 
 
 public class wraperopp{
     public opportunity opp{get;set;}
     public Boolean Selected{get;set;}
     public wraperopp(opportunity op)
     {
        opp=op;
        Selected=false;
     }
 }
}
Ranadheer chRanadheer ch
Amit the one which u sent also right...thanks amit and wizno...yes i did mistake with Action attribute...thanks both