You need to sign in to do that
Don't have an account?
bingi crm 7
Unknown property 'OpportunityLineItemStandardController.OppList' vf page showing error
visual force page
<apex:page standardController="OpportunityLineItem" extensions="Displayprods1">
<apex:form>
<apex:pageBlock>
<apex:repeat value="{!OppList}" var="a">
<apex:inputText value="{!a.name}"/>
<apex:inputText value="{!a.Quantity}"/>
<apex:inputText value="{!a.ListPrice}"/>
<apex:inputText value="{!a.nameTotalPrice}"/>
</apex:repeat>
</apex:pageBlock>
</apex:form>
</apex:page>
class controller
public class Displayprods1
{
public List<OpportunityLineItem> proList{get;set;}
List<OpportunityLineItemwrapper> OppList {get;set;}
public Displayprods1(ApexPages.StandardController controller)
{
OppList = new List<OpportunityLineItemwrapper>();
}
public OpportunityLineItem[] getOpportunityLineItemlist() {
return [select id,Quantity,ListPrice,TotalPrice from OpportunityLineItem limit10];
}
public void populate()
{
list<OpportunityLineItem > plist = [select id,Quantity,ListPrice,TotalPrice from OpportunityLineItem limit10];
for(OpportunityLineItem pr:plist)
{
OpportunityLineItemwrapper w1 = new OpportunityLineItemwrapper();
w1.name = pr.name;
w1.Quantity = Integer.valueOf(pr.Quantity);
w1.ListPrice = pr.ListPrice;
w1.TotalPrice = pr.TotalPrice;
OppList.add(w1);
}
}
}
wrapper class
public class OpportunityLineItemwrapper {
// all the line record instance create
public OpportunityLineItem pro{get; set;}
public string name {get;set;}
public integer Quantity {get;set;} // number
public decimal ListPrice {get;set;} // currency
public decimal TotalPrice {get;set;} // currency
public Boolean selected {get; set;} // true
public OpportunityLineItemwrapper()
{
name = '';
Quantity = 0;
ListPrice = 0 ;
TotalPrice = 0;
}
}
<apex:page standardController="OpportunityLineItem" extensions="Displayprods1">
<apex:form>
<apex:pageBlock>
<apex:repeat value="{!OppList}" var="a">
<apex:inputText value="{!a.name}"/>
<apex:inputText value="{!a.Quantity}"/>
<apex:inputText value="{!a.ListPrice}"/>
<apex:inputText value="{!a.nameTotalPrice}"/>
</apex:repeat>
</apex:pageBlock>
</apex:form>
</apex:page>
class controller
public class Displayprods1
{
public List<OpportunityLineItem> proList{get;set;}
List<OpportunityLineItemwrapper> OppList {get;set;}
public Displayprods1(ApexPages.StandardController controller)
{
OppList = new List<OpportunityLineItemwrapper>();
}
public OpportunityLineItem[] getOpportunityLineItemlist() {
return [select id,Quantity,ListPrice,TotalPrice from OpportunityLineItem limit10];
}
public void populate()
{
list<OpportunityLineItem > plist = [select id,Quantity,ListPrice,TotalPrice from OpportunityLineItem limit10];
for(OpportunityLineItem pr:plist)
{
OpportunityLineItemwrapper w1 = new OpportunityLineItemwrapper();
w1.name = pr.name;
w1.Quantity = Integer.valueOf(pr.Quantity);
w1.ListPrice = pr.ListPrice;
w1.TotalPrice = pr.TotalPrice;
OppList.add(w1);
}
}
}
wrapper class
public class OpportunityLineItemwrapper {
// all the line record instance create
public OpportunityLineItem pro{get; set;}
public string name {get;set;}
public integer Quantity {get;set;} // number
public decimal ListPrice {get;set;} // currency
public decimal TotalPrice {get;set;} // currency
public Boolean selected {get; set;} // true
public OpportunityLineItemwrapper()
{
name = '';
Quantity = 0;
ListPrice = 0 ;
TotalPrice = 0;
}
}
Let us know if this will help you
Thanks
Amit Chaudhary
Apex class Page like below
NOTE:- please create opportunity with product line item then check above code
Please let us know if this will help you