Im quite new to salesforce..need a little help.
i want to create a custom picklist in VF page, and then according to the value selected want to render a pageblocktable below on pressing a command button. This is my code snippet.
<apex:commandButton value="Filter" />
<apex:selectList multiselect="false" size="1">
<apex:selectOption itemValue="Qualification" itemLabel="Qualification"/>
<apex:selectOption itemValue="Closed Won" itemLabel="Closed Won"/>
<apex:selectOption itemValue="Closed Lost" itemLabel="Closed Lost"/>
</apex:selectList>
<apex:pageBlock >
<apex:pageBlockTable value="{!OppList2}" var="op2" title="Opportunities">
<apex:column value="{!op2.name}"/>
<apex:column value="{!op2.Accountid}"/>
<apex:column value="{!op2.CloseDate}"/>
<apex:column value="{!op2.Ownerid}"/>
<apex:column value="{!op2.Probability}"/>
</apex:pageBlockTable>
</apex:pageBlock>
controller:
public class Opp {
public List<Opportunity> OppList2{get; set;}
string searchquery='select name,accountid,ownerid,closedate,Probability from Opportunity ';
public Opp(){
OppList2=Database.query(searchquery);
}
}
Please help.