function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<apex:page controller="opportunityReportController" sidebar="false"> <apex:form > <apex:outputText >Open</apex:outputText> <apex:inputCheckbox value="{!Open}" /> <apex:actionSupport event="onclick" rerender="myTable" action="{!mytableData}"/> <apex:outputText >Closed/Won</apex:outputText> <apex:inputCheckbox value="{!Won}"/> <apex:actionSupport event="onclick" rerender="myTable" action="{!mytableData}"/> <apex:outputText >Closed/Lost</apex:outputText> <apex:inputCheckbox value="{!Lost}"/> <apex:actionSupport event="onclick" rerender="myTable" action="{!mytableData}"/> <apex:pageBlock > <apex:pageBlockTable value="{!oppList}" var="op" id="myTable"> <apex:column value="{!op.name}" headerValue="Name"/> <apex:column value="{!op.stageName}" headerValue="Stage"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
public class opportunityReportController { public List<opportunity> oppList { get; set; } public boolean Lost { get; set; } public boolean Won { get; set; } public boolean Open { get; set; } public opportunityReportController (){ open=false; lost=false; won=false; } public void mytableData() { oppList =new List<opportunity>(); list<opportunity> oppOpenList=[Select id,name,stageName from opportunity where stageName NOT IN('Closed Won','Closed Lost')]; list<opportunity> oppWonList=[Select id,name,stageName from opportunity where stageName ='Closed Won']; list<opportunity> oppLostList=[Select id,name,stageName from opportunity where stageName ='Closed Lost']; system.debug('>>>>>i am here>>'); if(open==true && Won==false && Lost==False){ oppList.addall(oppOpenList); } else if(open==true && Won==true && Lost==False){ oppList.addall(oppOpenList); oppList.addall(oppWonList); } else if(open==true && Won==true && Lost==true){ oppList.addall(oppOpenList); oppList.addall(oppWonList); oppList.addall(oppLostList); } else if(open==false && Won==true && Lost==false){ oppList.addall(oppWonList); } else if(open==false && Won==true && Lost==true){ oppList.addall(oppWonList); oppList.addall(oppLostList); } else if(open==false && Won==false && Lost==true){ oppList.addall(oppLostList); } else if(open==true && Won==false && Lost==true){ oppList.addall(oppLostList); oppList.addall(oppOpenList); } } }
Here is a sample code for you
VF Page Controller
If it fix your problem, Please dont forgot to mark it as best answer.