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
N@ypersN@ypers 

Filters in a 'pageBlockTable' using a custom controller

Hi, I'm creating a VF page, and I need to add 'filters' in a pageBlockTable, but I'm not using standarcontroller. Is possible to have filters in this case as shown in the image?

 

Please Help!

 

filters

 

I have something like this:

<< Visual Force >>

<apex:pageBlockTable value='{!myObjectOpportunities}' var='opp'>

 

<apex:column headerValue='Opportunity Name'>
<apex:outputText value='{!opp.name}' />
</apex:column>

 

<apex:column headerValue='Stage'>
<apex:outputText value='{!opp.stageName}' />
</apex:column>

 

<apex:column headerValue='Probability'>
<apex:outputText value='{!opp.Probability} %' />
</apex:column>

 

<apex:column headerValue='Close Date'>
<apex:outputText value='{!opp.closeDate}'/>
</apex:column>

 

</apex:pageBlockTable>

 

<< Class >>


public Opportunity[] getMyObjectOpportunities() {


List<Opportunity> itemsOpportunities;


itemsOpportunities = [ SELECT o.Name, o.stageName, o.closeDate,o.Id, o.Probability FROM Opportunity o WHERE CreatedById =: getUserId() ];

return itemsOpportunities ;
}

Best Answer chosen by Admin (Salesforce Developers) 
Devendra@SFDCDevendra@SFDC

 

Hi,

 

Please refer below post from Sam Arjmandi on sorting functionality on columns.

 

http://salesforcesource.blogspot.in/2008/11/adding-sorting-capability-to.html

 

Hope this helps.:)

 


All Answers

Devendra@SFDCDevendra@SFDC

 

Hi,

 

Please refer below post from Sam Arjmandi on sorting functionality on columns.

 

http://salesforcesource.blogspot.in/2008/11/adding-sorting-capability-to.html

 

Hope this helps.:)

 


This was selected as the best answer
N@ypersN@ypers

Perfect, thank you!