sorry here is the class public class DisplayOppRec { public Opportunity opp{get;set;} public list<opportunity> opps = new list<opportunity>(); public list<opportunity> getopps() {
opps = [select name,type,CloseDate from opportunity where StageName =: opp.stagename]; system.debug('display list values-----------'+opps); return opps; } }
public with sharing class PickListController {
public string stagename{get;set;}
public list<opportunity> opps = new list<opportunity>();
public list<opportunity> getopps()
{
opps = [select name,type,CloseDate from opportunity where StageName =: stagename];
system.debug('display list values-----------'+opps);
return opps;
}
}
i tried in my developer eddition it is working fine once again try it it will work.i changed some code and tried it.if u r not using standard controller then go for the praveen code.
Sry for the delay..
Try this.
Here we are not using standard controller so we need to hardcode the picklist.
Mark this as best answer if its helps.
Thanks.
All Answers
This will help you
http://stackoverflow.com/questions/8087392/salesforce-get-list-of-closed-opportunity-stages
Thanks
How to pass the selected picklist values from page to controller.
Thank You.
In this example,
selected value is stored in selectedcountry.
Thanks
Please look into my code,
<apex:page controller="DisplayOppRec">
<apex:form >
Stage Name <apex:inputField value="{!opp.StageName}">
<apex:actionsupport event="onchange" rerender="pb"/>
</apex:inputfield>
<apex:pageBlock id="pb" >
<apex:pageBlockTable value="{!opps}" var="v">
<apex:column value="{!v.name}"/>
<apex:column value="{!v.type}"/>
<apex:column value="{!v.CloseDate}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
-------------------------------------------------------------------------
public class DisplayOppRec
{
public Opportunity opp{get;set;}
public list<opportunity> opps = new list<opportunity>();
public list<opportunity> getopps()
{
opps = [select name,type,CloseDate from opportunity where StageName = 'Prospecting'];
system.debug('display list values-----------'+opps);
return opps;
}
}
public class DisplayOppRec
{
public Opportunity opp{get;set;}
public list<opportunity> opps = new list<opportunity>();
public list<opportunity> getopps()
{
opps = [select name,type,CloseDate from opportunity where StageName =: opp.stagename];
system.debug('display list values-----------'+opps);
return opps;
}
}
I am Praveen not pravven :),
here is the code
Mark this as best answer if its helps.
Thanks
<apex:page controller="DisplayOppRec">
<apex:form >
Stage Name <apex:inputField value="{!opp.StageName}">
<apex:actionsupport event="onchange" action="{!method1}" rerender="dd"/>
</apex:inputfield>
<apex:pageBlock >
<apex:outputPanel id="dd">
<apex:pageBlockTable value="{!opps}" var="v" id="pb">
<apex:column value="{!v.name}"/>
<apex:column value="{!v.type}"/>
<apex:column value="{!v.CloseDate}"/>
</apex:pageBlockTable>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
class:
public with sharing class DisplayOppRec {
public Opportunity opp{get;set;}
public list<opportunity> opps{get;set;}
public DisplayOppRec(){
opps=new list<opportunity>();
opp=new opportunity();
}
public pagereference method1()
{
system.debug('--opp.stagename--'+opp.stagename);
opps = [select name,type,CloseDate from opportunity where StageName =:opp.stagename];
system.debug('@@@@@@@@@@@@@result'+opps);
return null;
}
}
Mark this as best answer if its helps.
Thanks
can any one give solution for this please
Sry for the delay..
Try this.
Here we are not using standard controller so we need to hardcode the picklist.
Mark this as best answer if its helps.
Thanks.
i tried in my developer eddition it is working fine once again try it it will work.i changed some code and tried it.if u r not using standard controller then go for the praveen code.
thanks
Isha i want to know what changes u made in ur code .
without creating custom one
Good to hear.
I hope we can't. I have tried in many ways i can't pass the value to controller. But I am not 100 percent sure.
Thanks.
Thank you so much for spending time for my post.